IBM®
跳转到主要内容
    中国 [选择]    使用条款
 
 
Select a scope: Search for:    
    首页    产品    服务与解决方案     支持与下载    个性化服务    
跳转到主要内容

developerWorks 中国  >  SOA and Web services | XML  >

Web services programming tips and tricks: Improve interoperability between J2EE technology and .NET, Part 1

WSDL, RPC/encoded style, and WS-I conformance

developerWorks

Return to article


Listing 4: The WSDL document defining the rpc/encoded MakeFriend Web service

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://cyclic.test" xmlns:impl="http://cyclic.test" 
xmlns:intf="http://cyclic.test" 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
 <wsdl:types>
  <schema targetNamespace="http://cyclic.test" 
xmlns="http://www.w3.org/2001/XMLSchema" xmlns:impl="http://cyclic.test" 
xmlns:intf="http://cyclic.test" 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   <complexType name="Person">
    <sequence>
     <element name="name" nillable="true" type="xsd:string"/>
     <element name="friend" nillable="true" type="impl:Person"/>
    </sequence>
   </complexType>
   <element name="Person" nillable="true" type="impl:Person"/>
  </schema>
 </wsdl:types>
 <wsdl:message name="makeFriendResponse">
      <wsdl:part name="makeFriendReturn" type="intf:Person"/>
 </wsdl:message>
 <wsdl:message name="makeFriendRequest">
      <wsdl:part name="A" type="intf:Person"/>
      <wsdl:part name="B" type="intf:Person"/>
 </wsdl:message>
 <wsdl:portType name="MakeFriends">
      <wsdl:operation name="makeFriend" parameterOrder="A B">
           <wsdl:input message="intf:makeFriendRequest" name="makeFriendRequest"/>
           <wsdl:output message="intf:makeFriendResponse" 
name="makeFriendResponse"/>
      </wsdl:operation>
 </wsdl:portType>
      <wsdl:binding name="MakeFriendsSoapBinding" type="intf:MakeFriends">
           <wsdlsoap:binding style="rpc" 
transport="http://schemas.xmlsoap.org/soap/http"/>
           <wsdl:operation name="makeFriend">
           <wsdlsoap:operation soapAction=""/>
             <wsdl:input name="makeFriendRequest">
                <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
namespace="http://cyclic.test" use="encoded"/>
             </wsdl:input>
             <wsdl:output name="makeFriendResponse">
                <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
namespace="http://cyclic.test" use="encoded"/>
             </wsdl:output>
           </wsdl:operation>
     </wsdl:binding>
<wsdl:service name="MakeFriendsService">
     <wsdl:port binding="intf:MakeFriendsSoapBinding" name="MakeFriends">
         <wsdlsoap:address 
location="http://localhost:9080/CyclicTestEJBClient/services/MakeFriends"/>
     </wsdl:port>
</wsdl:service>
</wsdl:definitions>

Return to article

    关于 IBM 隐私条约 联系 IBM 使用条款