简体   繁体   中英

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

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).

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM