简体   繁体   中英

Is there a way to generate a SOAP Server in Java from a WSDL?

I'm required to code a SOAP client for a customer, but I only have the WSDL and no access to their SOAP Server.

I have successfully generated the SOAP client, but I would like to test it locally against a close approximation of their SOAP Server. So I want to generate a working SOAP Server framework from the supplied WSDL and modify it to supply some test data.

I've tried using Spring and Maven to generate the server code, but it doesn't seem to allow WSDLs - only XSD files. And all attempts to call any SOAP service from my client fails with 404s.

Has anyone successfully generated a SOAP Server using WSDLs? What are the gotcha's?

You can create skeleton code for the service implementation with something like wsdl2java . For example, with Axis2 or CXF:

I wouldn't bother though, since you can create a service mock with SoapUI starting from the same WSDL you would use to feed to wsdl2java . For example:

So start testing using SoapUI first, before going for a service implementation from the WSDL.

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