Generating Web Service from WSDL File

2019-01-14 07:16发布

问题:

I want to generate Web Service Classes from WSDL File. I want server side code not client side. wsimport creates client sides. which tool do you use to create server side code from WSDL File?

回答1:

Use NetBeans or Eclipse. Both of them make it really easy to create a new web service from an existing WSDL.

Eclipse tutorial: http://www.eclipse.org/webtools/community/tutorials/TopDownAxis2WebService/td_tutorial.html

NetBeans tutorial:
http://weblogs.java.net/blog/2008/03/05/developing-webservices-wsdl-using-netbeans



回答2:

To complete Andreas_D response, I have used wsdl2java to generate Java Web Service client from WSDL document.

Download page wsdl2java (binary distribution is ready to use)

You can simply generate code with command line :

wsdl2java -d output_directory/ document.wsdl

The code will be saved in output_directory folder.

Documentation for others arguments.



回答3:

Apache Axis could be your friend. It ships with a wsdl2java tool to autogenerate Java classes from a wsdl file for both client and server.

For testing and experimenting: use soapUi in addition.