2017-09-14 52 views
-1

假設我有WSDL文件,如下鑑於wsdl將使用不同的方法生成webservice客戶端生成不同的代碼?

<definitions name="HelloService" 
    targetNamespace="http://www.examples.com/wsdl/HelloService.wsdl" 
    xmlns="http://schemas.xmlsoap.org/wsdl/" 
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
    xmlns:tns="http://www.examples.com/wsdl/HelloService.wsdl" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 

    <message name="SayHelloRequest"> 
     <part name="firstName" type="xsd:string"/> 
    </message> 

    <message name="SayHelloResponse"> 
     <part name="greeting" type="xsd:string"/> 
    </message> 

    <portType name="Hello_PortType"> 
     <operation name="sayHello"> 
     <input message="tns:SayHelloRequest"/> 
     <output message="tns:SayHelloResponse"/> 
     </operation> 
    </portType> 

    <binding name="Hello_Binding" type="tns:Hello_PortType"> 
     <soap:binding style="rpc" 
     transport="http://schemas.xmlsoap.org/soap/http"/> 
     <operation name="sayHello"> 
     <soap:operation soapAction="sayHello"/> 
     <input> 
      <soap:body 
       encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
       namespace="urn:examples:helloservice" 
       use="encoded"/> 
     </input> 

     <output> 
      <soap:body 
       encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
       namespace="urn:examples:helloservice" 
       use="encoded"/> 
     </output> 
     </operation> 
    </binding> 

    <service name="Hello_Service"> 
     <documentation>WSDL File for HelloService</documentation> 
     <port binding="tns:Hello_Binding" name="Hello_Port"> 
     <soap:address 
      location="http://www.examples.com/SayHello/" /> 
     </port> 
    </service> 
</definitions> 

如果我們使用Apacje軸的Apache CXF 1.0 或wsimport的生成Web服務客戶端代碼。生成的代碼會不同(不包括註釋)?生成的類結構或類的數量。

回答

0

是的,生成的代碼會有所不同。 CXF和wsimport共享JAXB XJC作爲常用部分,但總體上不能將其用作一對一替換。

相關問題