我写了一个WebService服务端
然后准备写一个客户端对其进行测试
但在生成JAVA客户端代码时发生错误
WS-I: (BP2402) The wsdl:binding element does not use a soapbind:binding element as defined in section "3 SOAP Binding." of the WSDL 1.1 specification请帮我分析一下引发这个错误的原因会有哪些?
怎么解决这个问题?是不是要在服务端加代码?

解决方案 »

  1.   

    帮我分析一下有哪些原因可能出现这个错误吧!wsdl文件是公司机密,传上来不太妥,谢谢啦!
      

  2.   

    我的Wsdl是通过服务端生成的,出现这个错误,是不是我的服务端少了什么代码?
      

  3.   

    WSDL定义最好采用手动定义的方式,然后根据定义好的WSDL生成服务器和客户端的代码。原因在于不同的soap是吸纳,生成的WSDL定义有可能不满足WS-I协议
    <binding name="bindingSendSMSService" type="tns:typeSendSMSService">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="SendSMS">
    <soap:operation soapAction="SendSMS"/>
    <input>
    <soap:body use="literal"/>
    </input>
    <output>
    <soap:body use="literal"/>
    </output>
    </operation>
     </binding>上面是一个binding的例子
    binding 元素采用默认的命名空间是xmlns="http://schemas.xmlsoap.org/wsdl/" 
    soap命名空间:xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"