近来用java调用.net的 web service。
网上查阅了相关信息,如下操作后成功。
wsimport -keep -p cn.wsc.rm http://192.168.225.26/Imp/rm.asmx?wsdl
执行出错:
Cannot resolve the name 'soapenc:Array' .......
解决: 修改 soapenc:Array定义
原:
<s:complexType name="ArrayOfToneInfo">
<s:complexContent mixed="false">
<s:restriction base="soapenc:Array"><s:attribute wsdl:arrayType="tns:ToneInfo[]" ref="soapenc:arrayType"/></s:restriction></s:complexContent>
</s:complexType>
修改后:
<s:complexType name="ArrayOfToneInfo">
<s:sequence>
<s:element maxOccurs="unbounded" minOccurs="0" name="ToneInfo" nillable="true" type="tns:ToneInfo" />
</s:sequence>
</s:complexType>
修改后再执行:
出错:
rpc/encoded wsdls are not supported in JAXWS 2.0. line 69 of file.....
修改对应行"encoded"为 "literal"
再执行成功完成,问题解决。
另,对如下告警,用wsimport时按提醒要求加上 -extension选项,不然可能调用服务时返回空。
[WARNING] Ignoring SOAP port "RingManageSoap12": it uses non-standard SOAP 1.2 binding.
You must specify the "-extension" option to use this binding.
网上查阅了相关信息,如下操作后成功。
wsimport -keep -p cn.wsc.rm http://192.168.225.26/Imp/rm.asmx?wsdl
执行出错:
Cannot resolve the name 'soapenc:Array' .......
解决: 修改 soapenc:Array定义
原:
<s:complexType name="ArrayOfToneInfo">
<s:complexContent mixed="false">
<s:restriction base="soapenc:Array"><s:attribute wsdl:arrayType="tns:ToneInfo[]" ref="soapenc:arrayType"/></s:restriction></s:complexContent>
</s:complexType>
修改后:
<s:complexType name="ArrayOfToneInfo">
<s:sequence>
<s:element maxOccurs="unbounded" minOccurs="0" name="ToneInfo" nillable="true" type="tns:ToneInfo" />
</s:sequence>
</s:complexType>
修改后再执行:
出错:
rpc/encoded wsdls are not supported in JAXWS 2.0. line 69 of file.....
修改对应行"encoded"为 "literal"
再执行成功完成,问题解决。
另,对如下告警,用wsimport时按提醒要求加上 -extension选项,不然可能调用服务时返回空。
[WARNING] Ignoring SOAP port "RingManageSoap12": it uses non-standard SOAP 1.2 binding.
You must specify the "-extension" option to use this binding.