Gayan Dhanushka
Gayan Dhanushka

Reputation: 73

generate a soap request message using wsdl file

I have a wsdl of a web service with me. I want to generate the structure of the soap request message using this wsdl file. What would be the best way to generate a sample soap request message using the wsdl file? I want this to be done using a java based technology.

Thanks

Upvotes: 0

Views: 12809

Answers (2)

davidfmatheson
davidfmatheson

Reputation: 3567

I would recommend staring with a tool like SoapUI to generate raw SOAP requests. If you want to generate your SOAP requests with Java, then the general process is:

  1. Set up a project in Eclipse with the JAX-WS libraries.
  2. Run wsimport from Ant or Maven to generate client.
  3. Use the generated client to issue a request (see Developing WebService Client section).

Upvotes: 6

wallenborn
wallenborn

Reputation: 4273

Use one of the popular web service frameworks (Axis or CXF or whatever) and let it autogenerate the classes for you. See for example here for documentation on how to do this on the command line, and here for the corresponding maven plugin for CXF. Axis is very similar, i believe.

Whenever i need sample xml soap messages, i do this for server and client side, then start the dummy server with mvn tomcat:run and on the client side i construct the message in Java and let the framework log the message for me. Sounds more complicated than it actually is, especially considering that you probably need more than just one sample message and usually end up implementing your own dummy server anyway.

Upvotes: 1

Related Questions