| Author |
Query regarding SAAJ API
|
Jolly Tiwari
Ranch Hand
Joined: Mar 26, 2006
Posts: 77
|
|
Hi! Ivan,
As told by you i am able to invoke a web service through a SAAJ client without requiring any client artifacts
Now i have a query regarding a scenario which i am facing , I am making a SOAP message using an external file.
but it is showing strange behaviour.
The first msg.writeTo(System.out) is displaying the correct result
%%%%%%%%%%Creating a soap message from an external file%%%%%%%%
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body><ns:multiply xmlns:ns="http://saaj.com/"><arg0>80</arg0><arg1>10<
/arg1></ns:multiply></SOAP-ENV:Body></SOAP-ENV:Envelope>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
but the last two System.out.println() are displaying
can you please clarify?
Thanks in Advance
Regards
Jolly
|
 |
Ivan Krizsan
Bartender
Joined: Oct 04, 2006
Posts: 2193
|
|
Hi again!
First of all, you should close the input stream from which you read the SOAP message, as I show in my study notes.
Second, if you read the code in my study notes carefully, you would have noticed that it says that if you read a SOAP message from a file and there is a problem with the SOAP message, no error will be given and you won't experience any problems until you, for instance, try to retrieve the body or header of the SOAP message.
To test if your SOAP message has problems, I recommend replacing the contents of your input file with the example on page 200 in my study notes, which I know is correct.
Best wishes!
|
 |
Jolly Tiwari
Ranch Hand
Joined: Mar 26, 2006
Posts: 77
|
|
Hi! Ivan,
I tried your soap_input.xml file also ,everything is running fine but this snippet from my last post
System.out.println(hdr);
System.out.println(bod);
gives
[SOAP-ENV:Header: null]
[SOAP-ENV:Body: null]
Unable to figure out why??
Regards
Jolly
|
 |
 |
|
|
subject: Query regarding SAAJ API
|
|
|