Java 从 WSDL 文件生成 Web 服务
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3179229/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Generating Web Service from WSDL File
提问by firstthumb
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?
我想从 WSDL 文件生成 Web 服务类。我想要服务器端代码而不是客户端。wsimport 创建客户端。您使用哪种工具从 WSDL 文件创建服务器端代码?
回答by Andreas Dolk
Apache Axiscould be your friend. It ships with a wsdl2javatool to autogenerate Java classes from a wsdl file for both client and server.
Apache Axis可能是您的朋友。它附带了一个wsdl2java工具,用于从客户端和服务器的 wsdl 文件自动生成 Java 类。
For testing and experimenting: use soapUiin addition.
用于测试和实验:另外使用soapUi。
回答by Catchwa
Use NetBeansor Eclipse. Both of them make it really easy to create a new web service from an existing WSDL.
使用NetBeans或Eclipse。它们都使得从现有 WSDL 创建新的 Web 服务变得非常容易。
Eclipse tutorial: http://www.eclipse.org/webtools/community/tutorials/TopDownAxis2WebService/td_tutorial.html
Eclipse 教程: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
NetBeans 教程:http:
//weblogs.java.net/blog/2008/03/05/developing-webservices-wsdl-using-netbeans
回答by Samuel Dauzon
To complete Andreas_D response, I have used wsdl2java to generate Java Web Service client from WSDL document.
为了完成 Andreas_D 响应,我使用 wsdl2java 从 WSDL 文档生成 Java Web 服务客户端。
Download page wsdl2java(binary distribution is ready to use)
下载页面wsdl2java(二进制分发即可使用)
You can simply generate code with command line :
您可以使用命令行简单地生成代码:
wsdl2java -d output_directory/ document.wsdl
The code will be saved in output_directory folder.
代码将保存在 output_directory 文件夹中。