How can I get JAXM SOAP with Attachement parts?
I received a SOAP with attachment message.
Attached data is XML document("text/xml" type).
But when I try to get a attachment part by using below source code, I got a NullPointerException.
Iterator it = message.getAttachments();
AttachmentPart attachment = (AttachmentPart)it.next();
StreamSource content = (StreamSource)attachment.getContent(); <=content is not Null.
InputStream inputstream = content.getInputStream(); <= inputstream is Null.
StreamSource object is OK, but it doesn't return InputStream object.
Does anyone know what the problem is?
Thanks in advance.
Junhong.
Hi!
Use the following to get the stream:
InputStream is = attachment.getDataHandler().getInputStream();
Similar Messages
-
I purchased an ablum thru itunes on my phone and it says i purchased the songs on itunes but when i go on my music it says i have to repurchase all the songs how can i get the songs with out havin to pay again
Whether you can redownload music depends upon what country that you in. If you are using your computer's iTunes then does music show in the Purchased link under Quicklinks on the right-hand side of the iTunes store home page (on your phone you might be able to redownload media via the Purchased tab in the iTunes store app) ? If music shows there, but not that album, then check to see if it's hidden : http://support.apple.com/kb/HT4919
If you aren't in a country when you can redownload music and it's still on your phone then you should be able to copy it over from the phone via File > Devices > Transfer Purchases. -
How can I get the variable with the value from Thread Run method?
We want to access a variable from the run method of a Thread externally in a class or in a method. Even though I make the variable as public /public static, I could get the value till the end of the run method only. After that scope of the variable gets lost resulting to null value in the called method/class..
How can I get the variable with the value?
This is sample code:
public class SampleSynchronisation
public static void main(String df[])
sampleThread sathr= new sampleThread();
sathr.start();
System.out.println("This is the value from the run method "+sathr.x);
// I should get Inside the run method::: But I get only Inside
class sampleThread extends Thread
public String x="Inside";
public void run()
x+="the run method";
NB: if i write the variable in to a file I am able to read it from external method. This I dont want to doWe want to access a variable from the run method of a
Thread externally in a class or in a method. I presume you mean a member variable of the thread class and not a local variable inside the run() method.
Even
though I make the variable as public /public static, I
could get the value till the end of the run method
only. After that scope of the variable gets lost
resulting to null value in the called method/class..
I find it easier to implement the Runnable interface rather than extending a thread. This allows your class to extend another class (ie if you extend thread you can't extend something else, but if you implement Runnable you have the ability to inherit from something). Here's how I would write it:
public class SampleSynchronisation
public static void main(String[] args)
SampleSynchronisation app = new SampleSynchronisation();
public SampleSynchronisation()
MyRunnable runner = new MyRunnable();
new Thread(runner).start();
// yield this thread so other thread gets a chance to start
Thread.yield();
System.out.println("runner's X = " + runner.getX());
class MyRunnable implements Runnable
String X = null;
// this method called from the controlling thread
public synchronized String getX()
return X;
public void run()
System.out.println("Inside MyRunnable");
X = "MyRunnable's data";
} // end class MyRunnable
} // end class SampleSynchronisation>
public class SampleSynchronisation
public static void main(String df[])
sampleThread sathr= new sampleThread();
sathr.start();
System.out.println("This is the value from the run
method "+sathr.x);
// I should get Inside the run method::: But I get
only Inside
class sampleThread extends Thread
public String x="Inside";
public void run()
x+="the run method";
NB: if i write the variable in to a file I am able to
read it from external method. This I dont want to do -
How can I get the variable with the value from Thread's run method
We want to access a variable from the run method of a Thread externally in a class or in a method. Even though I make the variable as public /public static, I could get the value till the end of the run method only. After that scope of the variable gets lost resulting to null value in the called method/class..
How can I get the variable with the value?
This is sample code:
public class SampleSynchronisation
public static void main(String df[])
sampleThread sathr= new sampleThread();
sathr.start();
System.out.println("This is the value from the run method "+sathr.x);
/* I should get:
Inside the run method
But I get only:
Inside*/
class sampleThread extends Thread
public String x="Inside";
public void run()
x+="the run method";
NB: if i write the variable in to a file I am able to read it from external method. This I dont want to doYour main thread continues to run after the sathr thread is completed, consequently the output is done before the sathr thread has modified the string. You need to make the main thread pause, this will allow sathr time to run to the point where it will modify the string and then you can print it out. Another way would be to lock the object using a synchronized block to stop the main thread accessing the string until the sathr has finished with it.
-
How can I get an album with multiple artists to display in my Nano as one album insteadof multiple albums?
See this page for helpful information.
http://samsoft.org.uk/iTunes/grouping.asp
B-rock -
How can I get motherboard ID with flex?
How can I get motherboard ID with flex? I tried many. But I cannot find some way..
select distinct group_id
from tab_tmp t
where t.group_id not in (select distinct t2.group_id
from tab_tmp t2
where t2.colour = 'BLACK');
GROUP_ID
1 2220052-----
Edited by: stefan nebesnak on Feb 24, 2013 9:02 AM
In the TEST table there are the 'BLUE' and 'GREEN' values together in all cases, which confused me. ツ
<tt>
GROUP_ID COLOUR KEY
<font color="#FF0000">--1--</font>
8311226 <font style="background-color: #E7FA6B">GREEN</font> 12428183
8311226 <font style="background-color: #D7CEFF">BLUE</font> 12428183
8311226 <font style="background-color: #E7FA6B">GREEN</font> 35428017
8311226 BLACK 5415875
<font color="#FF0000">--2--</font>
2220052 <font style="background-color: #E7FA6B">GREEN</font> 12253085
2220052 WHITE 12253085
2220052 <font style="background-color: #D7CEFF">BLUE</font> 84553085
<font color="#FF0000">--3--</font>
3029178 BLACK 54587856
3029178 <font style="background-color: #D7CEFF">BLUE</font> 54587856
3029178 <font style="background-color: #E7FA6B">GREEN</font> 67080752
</tt> -
İ have an hp 3052 all in one.how can i get print out with ipad or iphone?
İ have an hp 3052 all in one.how can i get print out with ipad or iphone?
Hello,
Try following the instructions here http://h10025.www1.hp.com/ewfrf/wc/document?docname=c02623193&cc=ad&dlc=en&lc=en&jumpid=reg_r1002_us...
If that does not help, let me know and I will see what I can do.
-------------How do I give Kudos? | How do I mark a post as Solved? -------------------------------------------------------- -
How can I get wireless printing with my ipad?
How can I get wireless printing with my ipad?
Best way is to use an AirPrint compatible printer:
http://support.apple.com/kb/HT4356
If your printer is not AirPrint compatible, you might want to take a look at Printopia.
http://www.ecamm.com/mac/printopia/ -
I downloaded garage band on my iPad ages ago but now it just says waiting and when I click on it it just says "retry" and does nothing. I've spent literally ages making songs (I've got like 20 ). How can I get it back with all my songs still there?
Thanks for that. Much more constructive than the last comment. It's only the restriction code I can't recall, not the access passcode. So I can currently access the device, just not age restricted content. Does that's make a difference? I also wondered if anyone knew how many attempts you get to try to get it right. Now tried 21 times and so far nothing bad has happened but I am concerned I'll eventually be completely locked out of the device. That doesn't seem in the spirit of things though. Surely it's foreseeable that a child could repeatedly try to guess the code so I can't see that it would be right to lock the device down completely in that circumstance, particularly if the access code is being typed in correctly every time.
Thanks -
How can I get System dates with time scheduler using threads
how can I get System dates with time scheduler using threads.is there any idea to update Date in my application along with system Date automatic updation...
What the heck are you talking about and whatr has it to do with threads?
Current time: System.currentTimeMillis. Date instances are not supposed to be updated. -
How can I get my ipad2 with os5 to Kodak wireless printer esp9.
How can I get my ipad2 with os5 to Kodak wireless printer esp9.
Airprint won't work with the Kodak printers because Kodak does not support Airprint. You'll need to check in the App store to see if Kodak makes a printing app for the iPad. Otherwise, there are a number of third party printing apps. People have used Printopia, Print n Share, and Print Central with good results.
-
how can I get round the problem I have with itunes. I have bought and downloaded various tracks to my library. When I try to sync my iphone from my PC I get a message on screen saying that it is not authorised to play them and tells me to authorise the computer by clicking store, entering apple id and password then clicking authorise this computer. I do that then get a message saying that my computer is already authorised yet when I try syncing the track again the same thihng happens. Im getting nowhere!
If only some of the songs on an album are giving you the authorisation message, that suggests those song files are damaged.
If your country's iTunes Store allows you to redownload purchased tracks, I'd delete your current copies of the dodgy tracks and try redownloading fresh copies. For instructions, see the following document:
Downloading past purchases from the App Store, iBookstore, and iTunes Store
Otherwise, I'd report the problem to the iTunes Store.
Log in to the Store. Click on "Account" in your Quick Links. When you're in your Account information screen, go down to Purchase History and click "See all".
Find the items that are not playing properly. If you can't see "Report a Problem" next to the items, click the "Report a problem" button. Now click the "Report a Problem" links next to the items. -
How can I get a Album that contains multiple artists to appear as a single album with multiple tracks? Also when I sync iTunes with my iPhone or iPad the Album appears as multiple albums with each artist. The Album title is the same on each of the affected tracks.
Quick answer: Select all the tracks on the album, File > get info, and either give them all a single "album artist" or check the "compilation" flag.
If these are from multiple-CD sets you may also need to enter the appropriate information in the disc number fields. -
hi all, i just want to know how can i get a MacBook pro with the configuration i want from apple retail store (in Munich) and not by order it online because in this case i will not be able to benefit from Global blue service for tax free from the airport when i leave Germany.
thanks in advance.You should have probably found out more specifically from the Apple Store just how you could do it online. The obvious solution is to order it from the Apple Danish website store, but I don't know if they ship internationally.
http://store.apple.com/dk/browse/home/shop_mac/family/macbook_air -
I forgot the password icloud. How can i get it back with my alternate email?
I forgot my apple ID and iCloud password. But i still remember my alternate email (which is a gmail). I have already request the the reset email but i didnt receive anything from apple. I'm worry that the reset email will be sent to primary email (which i forgot).. So is there any chance that i can receive the reset email in my alternate email? Or how can i get my icloud account back with my alternate email???? Pleaseee help me
Hi there Nambin15,
There a a few recovery options for forgotten password that are availabe. I recommnd taking a look at the article below for more infomation on all your options.
If you forgot your Apple ID password
-Griff W.
Maybe you are looking for
-
Drive won't read any dvd .. ejects it automatically after spinin some time
My MBP is just some 2 months old and suddenly it has stopped recongnizing/reading the dvds, they dont even show up on the desktop, dont even read a blank dvd. it spins for some time with a noise and then ejects it out by itself. it is doing this for
-
Hello Experts, I am working on PI 7.1 and PI 7.4 , facing the issue while monitoring the messages in RWB. 1)In PI 7.4,when i give last week or this month under message monitor in Adapter engine for any interface ,only the latest messages(ie today an
-
Problem with decode!!!
Hi guys, I have a problem with "decode"! How can I tell the decode expression that if a rowset don't exists --> then doing something. I've tried that with "NULL" but that don't works. here my code: I wanted that if tx.text doesn't exists then it retu
-
What exactly is "combo audio in/out" interface?
My new W530 has "combo audio in/out". I have not had this kind of audio/sound card interface before? Before even trying all my stuff in it, do I understand this right? Instead of the regular green, burgundy, etc. speaker, microphone connectors, thi
-
Animated Title in Premiere Elements 7.0
I'm having problems in putting animation into a title in Premiere Elements 7.0. I begin making a title such as a title like this: Now the problem[ENTER] begins... When I type "Now the problem", I could apply an animation. Once I click ENTER & type "b