2

I have to create a web service equal to an existing one. The WSDL must be the same because they do not want to change the client. How can I do this?

Also, how I can do with JAX-WS with Maven?

Jops
  • 22,535
  • 13
  • 46
  • 63
user2225076
  • 23
  • 1
  • 1
  • 4
  • Do you have access to the SEI & SIB? It appears that you're being required to create a new implementation for a published service without altering any of the exposed operations. But please add more details. Your question is still too vague to answer. – Jops Mar 30 '13 at 06:40
  • I don't have access to the SEI & SIB. I have only WSDL. I have to public the same, but with differente businness logic. The client don't be know that i have change it. – user2225076 Apr 02 '13 at 15:05

1 Answers1

4

Recreating a Web Service from WSDL

Based on the book, Java Web Services: Up and Running by Martin Kalin, one way to recreate a service from a WSDL is by starting at the client stubs.

wsimport -keep -p <your wsdl>

The item of interest will be the generated SEI code.

You can remove the client-specific annotations, replace them with server-side annotations and use this as your base interface when rebuilding the web service.

With the SEI at your disposal, you can easily create your own SIB and publish it.

Important Note: Of course, you will not see the logic behind their SIB, that will not be available to you at any point. But the above approach will hopefully be useful for you since you want to create your own implementation anyway.

JAX-WS with Maven

This deserves a separate question on its own. Maven has a jax-ws plugin (artifact ID: jaxws-maven-plugin) for you to start with. More info at this link: Using JAX-WS with Maven.

Jops
  • 22,535
  • 13
  • 46
  • 63
  • Thank's for your explanation. I used the jaxws-maven-plugin, but the second WSDL is not equal to the first one. Is it possible to say to the plugin to show the first one?? I know that it is possible with AXIS but i don't know with JAX-WS. – user2225076 Apr 02 '13 at 16:29
  • What kind of differences? On which section of the WSDL? – Jops Apr 03 '13 at 01:24
  • I did it. Thank's very much. First i create client with jaxws-maven-plugin and then i create a web-server form WSDL with jaxws-maven-plugin. Finally i had exatly the same WSDL. – user2225076 Apr 04 '13 at 12:22
  • `-p` requires a package name in JDK7. It seems, that `-p` can just be omitted. – koppor Apr 09 '15 at 19:07
  • wsimport doesnt support encodings though. That's why I'm using Axis2 as of now. – Kevin Tan Feb 04 '16 at 12:04