Skip to main content

SOAP over HTTP/POST

2 replies [Last post]
sabatier_sabrika
Offline
Joined: 2007-07-09

Hi everyone,
I'd be eternally grateful if someone could provide me with a quick + easy solution to the following (basic?) task.

I have a user form with the required parameters and a submit button. I have an XML schema which specifies the format for the soap requests and responses. How do I accept user input, wrap it into a soap request, send it via HTTP/POST to a server ( http://localhost:9999/xyz/xyz), wait for a soap response and display the response in a readable format to the user when they press the submit button? Not that hard is it?!

Please try to be a specific as possible because I'm no Java expert. I'm just so confused with all the tutorials about wsdl, bpel, tomcat, jax ws, glassfish etc etc etc!

I use netbeans and java app server 9, though I'm open to other IDEs/servers.

Any help will be greatly appreciated,

Ruth

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
applebanana8
Offline
Joined: 2004-06-16

Post a xml document (based on the schema you have you + user input). Parse the http response for the things you want display to the user.

Google for "soap tester", especially javascript-based tools. Handy in testing.

ethere0683
Offline
Joined: 2003-06-18

You are talking about web services. All the documentation out there is really confusing because things have changed significantly. I suggest you use JDK1.6 for this task as things have changed a lot in recent years. You want to call a web service. In order to do this you:

1) Get a WSDL location. The WSDL is an XML file that describes the web service method you will be calling. Your vendor can probably give you a URL to get this. It will probably look something like: http://www.vendor.com/xyz?WSDL. If you go to the URL with your browser it should display the XML WSDL.
2) Run wsimport passing the url to the WSDL. This will create Java stub files that will call the web service. wsimport is part of jdk1.6.
3) Use the java stub files to call the web service. wsimport will create a service file and a port file (aswell as other files). instantiate a new service instance and then use that to instantiate a new port instance. you can then call the web service with the port.

*whew* Morale of the story is that any docs you look at should be about JAX-WS. Theres a lot of stuff out there about JAX-RPC which is the older version that you shouldnt use.