0

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?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Matt Robinson
  • 55
  • 1
  • 9
  • JAX-WS has `wsimport` – Thorbjørn Ravn Andersen Jun 08 '22 at 05:08
  • Oh. I thought wsimport only produced SOAP Clients to consume the services described in the WSDL, not SOAP Server frameworks to provide those services. Can you help me with the wsimport command line to create the server side, please? – Matt Robinson Jun 08 '22 at 05:26
  • I misread the question and it's been more than 10 years since I worked with SOAP so sorry you are right, wsimport only creates the client. I used Glassfish back then to automatically create the WSDL from running code. It looks like Spring can create a server from WSDL - https://www.baeldung.com/spring-boot-soap-web-service looks promising. – Thorbjørn Ravn Andersen Jun 08 '22 at 05:56
  • No problem. It's been about that long for me too.. :) – Matt Robinson Jun 09 '22 at 06:11

1 Answers1

3

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.

Bogdan
  • 23,890
  • 3
  • 69
  • 61