访问?wsdl页面时接收重复的wsdl:binding和wsdl:service

时间:2015-04-01 20:57:21

标签: web-services wsdl cxf

我创建了一个WSDL,并在JBoss Fuse中将Web服务公开为CXF端点。我在WSDL中指定了一个wsdl:binding和一个wsdl:service,但在将它部署到JBoss Fuse并访问http://localhost:8081/PlaceOrderService?wsdl之后,我得到了重复的wsdl:binding和wsdl:service。谁知道为什么?

WSDL - 一个wsdl:binding和wsdl:service

<wsdl:message name="orderRecordRequest">
  <wsdl:part name="orderRecordInput" element="typens:orderRecordRequest" />
</wsdl:message>

<wsdl:message name="orderRecordResponse">
  <wsdl:part name="orderRecordOutput" element="typens:orderRecordResponse"/>
</wsdl:message>

<wsdl:portType name="PlaceOrderService">
  <wsdl:operation name="OrderService">
    <wsdl:input message="tns:orderRecordRequest"/>
    <wsdl:output message="tns:orderRecordResponse"/>
  </wsdl:operation>
</wsdl:portType>

<wsdl:binding name="PlaceOrderServiceSOAPBinding" type="tns:PlaceOrderService">
  <soap:binding style="document"
        transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="OrderService">
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
</wsdl:binding>    
<wsdl:service name="PlaceOrderService">
    <wsdl:port binding="tns:PlaceOrderServiceSOAPBinding" name="PlaceOrderPort">
        <soap:address location="http://localhost:8081/PlaceOrderService"/>
    </wsdl:port>
</wsdl:service> 

http://localhost:8081/PlaceOrderService?wsdl 复制wsdl:binding和wsdl:service

      <wsdl:binding name="PlaceOrderServiceSOAPBinding" type="tns:PlaceOrderService">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="OrderService">
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:binding name="PlaceOrderServiceSoapBinding" type="tns:PlaceOrderService">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="OrderService">
      <soap:operation soapAction="" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>  
    <wsdl:service name="PlaceOrderServiceService">
    <wsdl:port binding="tns:PlaceOrderServiceSoapBinding" name="PlaceOrderServicePort">
      <soap:address location="http://localhost:8081/PlaceOrderService"/>
    </wsdl:port>
  </wsdl:service>  
    <wsdl:service name="PlaceOrderService">
    <wsdl:port binding="tns:PlaceOrderServiceSOAPBinding" name="PlaceOrderPort">
      <soap:address location="http://localhost:8081/PlaceOrderService"/>
    </wsdl:port>
  </wsdl:service>

1 个答案:

答案 0 :(得分:0)

我知道我的列车迟到了,但对于那些有类似问题的人:请注意绑定名称中的不同情况,确保WSDL中的名称与生成的Java类中的名称匹配。