File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes Query regarding SAAJ API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Query regarding SAAJ API" Watch "Query regarding SAAJ API" New topic

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="">
<SOAP-ENV:Body><ns:multiply xmlns:ns=""><arg0>80</arg0><arg1>10<

but the last two System.out.println() are displaying

can you please clarify?

Thanks in Advance


Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
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



[SOAP-ENV:Header: null]
[SOAP-ENV:Body: null]

Unable to figure out why??


I agree. Here's the link:
subject: Query regarding SAAJ API
It's not a secret anymore!