Udostępnij za pośrednictwem


Web Services Quiz: Issue 8

Given the following WSDL, how does your .NET proxy and stub look like?

As always, answer and explanation will follow…

Note, it’s rpc-literal …

<?xml version="1.0" encoding="utf-8"?>

<wsdl:definitions targetNamespace="uri.test.com"  

xmlns:wsdl="https://schemas.xmlsoap.org/wsdl/"

xmlns:soap="https://schemas.xmlsoap.org/wsdl/soap/"

xmlns:xsd="https://www.w3.org/2001/XMLSchema"

xmlns:tns="uri.test.com"

xmlns="https://schemas.xmlsoap.org/wsdl/">

   <wsdl:types>

      <xsd:schema elementFormDefault="qualified" targetNamespace="uri.test.com">

  

         <xsd:complexType name="AddRequestType">

            <xsd:sequence>

               <xsd:element minOccurs="1" maxOccurs="1" name="a" type="xsd:int" />

               <xsd:element minOccurs="1" maxOccurs="1" name="b" type="xsd:int" />

       </xsd:sequence>

         </xsd:complexType>

         <xsd:complexType name="AddResponseType">

            <xsd:sequence>

               <xsd:element minOccurs="1" maxOccurs="1" name="c" type="xsd:int" />

            </xsd:sequence>

         </xsd:complexType>

      </xsd:schema>

   </wsdl:types>

   <wsdl:message name="AddRequestMsg">

      <wsdl:part name="AddRequest" type="tns:AddRequestType" />

   </wsdl:message>

   <wsdl:message name="AddResponseMsg">

      <wsdl:part name="AddResponse" type="tns:AddResponseType" />

   </wsdl:message>

   <wsdl:portType name="CalculatorPortType">

      <wsdl:operation name="Add">

         <wsdl:input message="tns:AddRequestMsg" />

         <wsdl:output message="tns:AddResponseMsg" />

      </wsdl:operation>

  </wsdl:portType>

   <wsdl:binding name="CalculatorSoap" type="tns:CalculatorPortType">

   <soap:binding style="rpc" transport="https://schemas.xmlsoap.org/soap/http"/>

   <wsdl:operation name="Add">

   <soap:operation soapAction="uri.test.com/add"/>

   <wsdl:input>

   <soap:body parts="AddRequest" use="literal"/>

   </wsdl:input>

   <wsdl:output>

   <soap:body parts="AddResponse" use="literal"/>

   </wsdl:output>

   </wsdl:operation>

   </wsdl:binding>

  <wsdl:service name="Issue7Service">

  <wsdl:port binding="tns:CalculatorSoap" name="CalculatorPortType">

  <soap:address location="https://test.com/Issue7/Issue7Service.asmx"/>

  </wsdl:port>

   </wsdl:service>

</wsdl:definitions>

Comments