This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Web Services and the fly likes sample for sending a raw SOAP message to a service? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "sample for sending a raw SOAP message to a service?" Watch "sample for sending a raw SOAP message to a service?" New topic
Author

sample for sending a raw SOAP message to a service?

Jeff Boucher
Greenhorn

Joined: Aug 18, 2008
Posts: 14
Hi,

I've looked at a number of examples that show how to use a client-api for sending a SOAP message to a service, as well as how to view the incoming SOAP message as XML... however, I've looked around and haven't been able to find a simple case where creates a SOAP message as raw XML and submits it directly to the service (maybe as a post?) Does anyone know of samples out there where this is done?

Thanks!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
As you said, it's just an HTTP POST of some text, so something like this should work.


Ping & DNS - updated with new look and Ping home screen widget
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12678
    
    5
Here is what I used, where the reqT object reads a text template of the SOAP message and fills in a couple of values. The main things here are to get the various HttpURLConnection parameters set right before connecting AND to read the response before closing the connection.



The response variable is an instance String.


Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sample for sending a raw SOAP message to a service?
 
Similar Threads
Webservices Client
Strip Out XML From SOAP to Validate
Printing Raw Request HTML
Putting string in soap message
Conversion of message to SOAP in web service