简体   繁体   中英

Auto-generate web-service JAX-WS from WSDL

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?

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 .

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