I have JDK 17 and JDK 1.8 on my Windows PC. Why does JDK 17 not contain wsgen.exe in the bin directory while JDK 1.8 contains it? How can I build web applications without wsgen?
CodePudding user response:
Why does JDK 17 not contain wsgen.exe in the bin directory while JDK 1.8 contains it?
Because JEP 320 has removed 9 modules from Java 11, removing alongside tools such as wsgen
and wsimport
(from jdk.xml.ws
).
How can I build web applications without wsgen?
Do you mean how to build? or how to generate/scaffold some code? for building, there are different tools, but for whatever you used wsgen
, you could probably refer to maven plugins, some of which you can find here.
You may also find useful this thread.
CodePudding user response:
The wsgen tool is a command-line utility that is used to generate web service artifacts for JAX-WS (Java API for XML Web Services) applications. The tool was first introduced in JDK 6 and is included in JDK versions up to and including JDK 8.
However, in JDK 9, Oracle decided to remove the wsgen and wsimport tools, and recommended to use the javax.xml.ws.annotation.WSDLGenerator annotation and the javax.xml.ws.wsgen and javax.xml.ws.wsimport tools instead.
So, if you are using JDK 17, it will not contain wsgen.exe in bin directory.
To build web applications without wsgen, you can use different tools like Apache CXF, Spring-WS, or even a framework like JAX-RS (Java API for RESTful Web Services) with a tool like Jersey or RESTEasy.
You can also use the javax.xml.ws.annotation.WSDLGenerator annotation and the javax.xml.ws.wsgen and javax.xml.ws.wsimport tools to generate your web service artifacts.
Also, you can use the maven-jaxws-plugin to generate the web service artifacts instead of wsgen.