This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 2919
    
    5
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 ]
Krithi Raghu
Greenhorn

Joined: Jan 15, 2008
Posts: 23
Thanks Peer. It is working now...
I made the following changes in my code...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: IllegalArgumentException while creating SOAP message
 
Similar Threads
How to get document object From SOAP Message?
Query regarding SAAJ API
unable to read soapmessage
Encrypting a SOAP message
Generate SOAP message from Java class