【发布时间】:2013-12-24 18:17:06
【问题描述】:
如何从远程 wsdl 为 jax-ws 应用程序生成 java 工件(Web 服务客户端)。
我尝试了以下选项,但没有运气。是他们创建它的任何其他方式。
wsimport -d d:\test\ -s d:\cool wsdlurl(which is remote url)(eg.. http://servername/service.asmx?WSDL)
上面的命令在windows命令提示符下运行出现以下错误。
[ERROR] Property "Any" is already defined. Use <jaxb:property> to resolve this conflict.
line 37 of http://xxx.xxxindia.com/service.asmx?WSDL
任何帮助将不胜感激。谢谢
添加一段 WSDL 以供参考。我在“任何”属性点出现错误
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://well.service.com/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
targetNamespace="http://well.service.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://well.service.com/">
<s:element name="WhoAmI">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="AccountId" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="UserName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Password" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="WhoAmIResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="WhoAmIResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="SourceCity_InTravelTypeID">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="TravelTypeID" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="AccountId" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="UserName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Password" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="SourceCity_InTravelTypeIDResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="SourceCity_InTravelTypeIDResult">
<s:complexType>
<s:sequence>
<s:any minOccurs="0" maxOccurs="unbounded" namespace="http://www.w3.org/2001/XMLSchema" processContents="lax" />
<s:any minOccurs="1" namespace="urn:schemas-microsoft-com:xml-diffgram-v1" processContents="lax" />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="DestinationCity_InTravelTypeID">
<s:complexType>
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="TravelTypeID" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="StateID" type="s:int" />
<s:element minOccurs="1" maxOccurs="1" name="AccountId" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="UserName" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Password" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="DestinationCity_InTravelTypeIDResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="DestinationCity_InTravelTypeIDResult">
<s:complexType>
<s:sequence>
<s:any minOccurs="0" maxOccurs="unbounded" namespace="http://www.w3.org/2001/XMLSchema" processContents="lax" />
<s:any minOccurs="1" namespace="urn:schemas-microsoft-com:xml-diffgram-v1" processContents="lax" />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
【问题讨论】:
标签: web-services jax-ws