File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes IllegalArgumentException while creating SOAP message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "IllegalArgumentException while creating SOAP message" Watch "IllegalArgumentException while creating SOAP message" New topic
Author

IllegalArgumentException while creating SOAP message

Krithi Raghu
Greenhorn

Joined: Jan 15, 2008
Posts: 23
Hi,

I have an input xml file and am trying to convert this to a SOAP message. For this I am using the following code

But I get an error during runtime.

I could not make out what exactly is going wrong in this. Could someone please help me out?
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
IF the order.xml is the entire SOAP envelope (message) then this example shows you how to do it - you would have to adapt your FileInpuStream to a StreamSource.

IF however order.xml only contains the content for the SOAP body then you have to read it in as an org.w3c.dom.Document and then set the SOAPBody as described here.
[ May 07, 2008: Message edited by: Peer Reynders ]

"Don't succumb to the false authority of a tool or model. There is no substitute for thinking."
Andy Hunt, Pragmatic Thinking & Learning: Refactor Your Wetware p.41
Krithi Raghu
Greenhorn

Joined: Jan 15, 2008
Posts: 23
Thanks Peer. It is working now...
I made the following changes in my code...
 
wood burning stoves
 
subject: IllegalArgumentException while creating SOAP message
 
Similar Threads
Query regarding SAAJ API
How to get document object From SOAP Message?
unable to read soapmessage
Encrypting a SOAP message
Generate SOAP message from Java class