wsdl生成客户端代码--wsimport

近来用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.
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值