简体   繁体   English

如何从WSDL生成简单的java类?

[英]How to generate simple java class from WSDL?

I want to generate a simple java class from this WSDL url: 我想从这个WSDL url生成一个简单的java类:

https://xyz.pqr.com/Portal/Service.svc?wsdl

How can I do this? 我怎样才能做到这一点? I am looking for a tool which can generate the code. 我正在寻找一个可以生成代码的工具。

You can use Apache Axis. 您可以使用Apache Axis。

It comes with a tool ie WSDL2Java converter. 它附带了一个工具,即WSDL2Java转换器。

using below command. 使用以下命令。

wsdl2java.bat -uri [URL of WSDL file] (on Windows)

or 要么

wsdl2java.sh -uri [URL of WSDL file] on Linux

Through this you can generate the Stub classes from WSDL. 通过这个,您可以从WSDL生成Stub类。

For me the best tool for generating java classes for my WCF web service is 对我来说,为我的WCF Web服务生成java类的最佳工具是

http://easywsdl.com/ http://easywsdl.com/

It uses ksoap2 library and supports complex types (with inheritance), data in attributes, header values and WCF extensions like Guid data type and data contract with IsReference attribute. 它使用kso​​ap2库并支持复杂类型(具有继承),属性中的数据,标头值和WCF扩展(如Guid数据类型和与IsReference属性的数据协定)。

这里的一些示例可能对您有所帮助: Apache CXF项目

或者只使用JDK文档,JDK上的1.6包含JAX-WS功能作为标准,包括使用wsimport从WSDL生成客户端存根的工具。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM