4.6. MathService.wsdl: WSDL code for a WSRF service


<?xml version="1.0" encoding="UTF-8"?>
<definitions name="MathService"
    targetNamespace="http://www.globus.org/namespaces/examples/core/MathService_instance"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="http://www.globus.org/namespaces/examples/core/MathService_instance"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<!--============================================================

                      T Y P E S

  ============================================================-->
<types>
<xsd:schema targetNamespace="http://www.globus.org/namespaces/examples/core/MathService_instance"
    xmlns:tns="http://www.globus.org/namespaces/examples/core/MathService_instance"
    xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">

        <!-- IMPORT WS-ADDRESSING -->
        <xsd:import namespace="http://schemas.xmlsoap.org/ws/2004/03/addressing"
             schemaLocation="http://schemas.xmlsoap.org/ws/2004/03/addressing"/>

        <!-- REQUESTS AND RESPONSES -->

        <xsd:element name="add" type="xsd:int"/>
        <xsd:element name="addResponse">
                <xsd:complexType/>
        </xsd:element>

        <xsd:element name="subtract" type="xsd:int"/>
        <xsd:element name="subtractResponse">
                <xsd:complexType/>
        </xsd:element>

        <xsd:element name="getValueRP">
                <xsd:complexType/>
        </xsd:element>
        <xsd:element name="getValueRPResponse" type="xsd:int"/>

        <xsd:element name="create">
                <xsd:complexType/>
        </xsd:element>
        <xsd:element name="createResponse">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element ref="wsa:EndpointReference"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>

        <xsd:element name="Value" type="xsd:int"/>
        <xsd:element name="LastOp" type="xsd:string"/>
        <xsd:element name="MathResourceProperties">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element ref="tns:Value"/>
                    <xsd:element ref="tns:LastOp"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>

</xsd:schema>
</types>


<!--============================================================

                       M E S S A G E S

  ============================================================-->
<message name="AddInputMessage">
        <part name="parameters" element="tns:add"/>
</message>
<message name="AddOutputMessage">
        <part name="parameters" element="tns:addResponse"/>
</message>

<message name="SubtractInputMessage">
        <part name="parameters" element="tns:subtract"/>
</message>
<message name="SubtractOutputMessage">
        <part name="parameters" element="tns:subtractResponse"/>
</message>

<message name="GetValueRPInputMessage">
        <part name="parameters" element="tns:getValueRP"/>
</message>
<message name="GetValueRPOutputMessage">
        <part name="parameters" element="tns:getValueRPResponse"/>
</message>

<message name="CreateInputMessage">
        <part name="parameters" element="tns:create"/>
</message>
<message name="CreateOutputMessage">
        <part name="parameters" element="tns:createResponse"/>
</message>

<!--============================================================

                       P O R T T Y P E

  ============================================================-->

<portType name="MathPortType"
    wsrp:ResourceProperties="tns:MathResourceProperties">

        <operation name="add">
                <input message="tns:AddInputMessage"/>
                <output message="tns:AddOutputMessage"/>
        </operation>

        <operation name="subtract">
                <input message="tns:SubtractInputMessage"/>
                <output message="tns:SubtractOutputMessage"/>
        </operation>

        <operation name="getValueRP">
                <input message="tns:GetValueRPInputMessage"/>
                <output message="tns:GetValueRPOutputMessage"/>
        </operation>

        <operation name="createResource">
                <input message="tns:CreateInputMessage"/>
                <output message="tns:CreateOutputMessage"/>
        </operation>


</portType>

<!--============================================================

                       B I N D I N G

  ============================================================-->
<binding name="MathBinding" type="MathPortType">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

    <wsdl:operation name="add">
      <soap:operation soapAction=""/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>

    <wsdl:operation name="subtract">
      <soap:operation soapAction=""/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>

    <wsdl:operation name="getValueRP">
      <soap:operation soapAction=""/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>

    <wsdl:operation name="createResource">
      <soap:operation soapAction=""/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
</binding>

<!--============================================================

                       S E R V I C E

  ============================================================-->
<service name="MathService">
    <port name="MathPort" binding="MathBinding">
       <soap:address location="http://localhost:8080/wsrf/services/"/>
    </port>
</service>

</definitions>