Reputation: 73
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
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:
wsimport
from Ant or Maven to generate client.Upvotes: 6
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