Section 16.3. Web Service Descriptions


16.3. Web Service Descriptions

The aggregation service that provides the validation and purchase operations has the following service description. For simplicity and readability, Schema definitions have not been included and namespace declarations have been skipped; as in the previous chapter, the examples are meant to be illustrative rather than executable.

<definitions targetNamespace="...">        <!-- WSDL definitions in this document -->        <!-- referenced using "tns" prefix -->        <types>           <!-- XSD definitions for this service -->           <!-- referenced using "xsd1" prefix -->           <xsd:schema>              <xsd:import namespace="http://www.purchase.com/xsd/svp-svc">           </xsd:schema>        </types>        <message name="purchaseResponse">           <part name="purchaseResponse" element="xsd1:PurchaseStatus"/>        </message>        <message name="purchaseRequest">           <part name="purchaseRequest" element="xsd1:PurchaseRequest"/>        </message>        <message name="ServicePacValidationInput">           <part name="spvDataInput" element="xsd1:ServicePacValidationData"/>        </message>        <message name="ServicePacValidationOutput">           <part name="spvDataOutput" element="xsd1:ServicePacValidationData"/>        </message>        <portType name="spvPortType">           <operation name="purchaseServicePacs">              <input name="purchaseInput" message="tns:purchaseRequest"/>              <output name="purchaseOutput"                      message="tns:purchaseResponse"/>           </operation>           <operation name="validateServicePac">              <input name="Input" message="tns:ServicePacValidationInput"/>        <output name="Output"                message="tns:ServicePacValidationOutput"/>           </operation>        </portType>         name="spvBinding"           type="tns:spvPortType">           <wsp:PolicyReference URI= "http://www.purchase.com/policies/DSig">      <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>           <operation name="purchaseServicePacs">              <wsp:PolicyReference URI= "http://www.purchase.com/policies/Encrypt">        <soap:operation soapAction= "http://www.purchase.com/spvPortType/purchaseServicePacsRequest"/>           </operation>           <operation name="validateServicePac">               <soap:operation soapAction= "http://www.purchase.com/spvPortType/validateServicePacRequest"/>           </operation> </binding>        <service name="spv-svc">           <port name="spv-svc-port" binding="tns:spvBinding">              <soap:address location="http://www.purchase.com/spv"/>           </port>        </service>     </definitions> 

Note that the service binding indicates that all operations that the service offers require messages to be signed; the purchase operation also requires encryption. A policy requiring digital signature of messages is attached to the binding element, and a policy requiring encryption is attached to the purchase operation. As in the previous chapter, this example doesn't provide explicit policies because policy dialects are still in the process of being developed.

Among the back-end services that are integrated in this example, the focus here is on the services that the purchase operation uses. A simplified definition of the profile update service follows.

<definitions targetNamespace="..."> <!-- WSDL definitions in this document    --> <!-- referenced using "tns" prefix        -->    <types>    <!-- XSD definitions for this service  -->    <!-- referenced using "xsd1" prefix    -->        <xsd:schema>           <xsd:import namespace=                  "http://www.purchase.com/xsd/customer-profile"/>           </xsd:schema>    </types>    <message name="addSPVsRqst">       <part name="newSPVs" element="xsd1:newClientSPVs"/>    </message>    <message name="SPVAdditionStatus">       <part name="ret" element="tns:status"/>    </message>       <portType name="SPVProfileUpdatePT">          <operation name="updateProfile">             <input message="tns:addSPVsRqst"/>             <output message="tns:SPVAdditionStatus"/>       </operation>    </portType>    <binding name="ProfileBinding" type="tns:SPVProfileUpdatePT">       <wsp:PolicyReference URI=       "http://purchase.com/policies/ATMandatory">       <soap:binding style="document" transport=         "http://schemas.xmlsoap.org/soap/http"/>         <operation name="updateProfile">            <soap:operation soapAction= "http://www.purchase.com/SPVProfileUpdatePT/updateProfileRequest"/>        </operation>     </binding>     <service name="spv-customer-profile">        <port name="spv-svc-port" binding="tns:ProfileBinding">          <soap:address                location="http://www.purchase.com/profile"/>        </port>     </service> </definitions> 

In this case, no security policies have been attached based on the fact that the interaction takes place behind the enterprise firewall. However, a policy has been attached to the binding, mandating the use of the atomic transaction protocol. The policy states that a new transaction context must be passed on when the service is invoked. The definition of the purchase service contains a similar binding to support the execution of the application code under an atomic transaction that the invoker service initiates.

 <definitions name="Account" targetNamespace="..."> <!-- WSDL definitions in this document    --> <!-- referenced using "tns" prefix        -->      <types>      <!-- XSD definitions for this service  -->      <!-- referenced using "xsd1" prefix    -->          <xsd:schema>          <xsd:import namespace=              "http://www.purchase.com/xsd/account"/>          </xsd:schema>      </types>      <message name="CreditAccountRequest">         <part name="CreditAccountReq"               element="xsd1:CreditAccountRequest"/>      </message>      <message name="AccountResponse">         <part name="accountResp" element="xsd1:AccountMsg"/>      </message>      <message name="ChargeAccountRequest">        <part name="chargeAccountReq"              element="xsd1:ChargeAccountRequest"/>"      </message>      <message name="InsufficientAccountsFault">        <part name="fault" element="xsd1:AccountFaultInfo"/>      </message>      <portType name="AccountPortType">         <operation name="CreditAccount">            <input name="CreditAccount"                   message="tns:CreditAccountRequest"/>            <output name="CreditAccountResponse"                    message="tns:AccountResponse"/>         </operation>         <operation name="ChargeAccount">            <input name="ChargeAccount"                   message="tns:ChargeAccountRequest"/>            <output name="ChargeAccount"                    message="tns:AccountResponse"/>            <fault message="tns:InsufficientAccountsFault"                   name="f2"/>         </operation>    </portType>    <binding name="AccountBinding" type="tns:AccountPortType">      <wsp:PolicyReference URI=          "http://purchase.com/policies/ATMandatory">      <soap:binding style="document"       transport="http://schemas.xmlsoap.org/soap/http"/>    </binding>    <service name="accounting">      <port binding="AccountBinding">         <soap:address          location="http://www.purchase.com/account"/>      </port>     </service> </definitions> 



    Web Services Platform Architecture(c) SOAP, WSDL, WS-Policy, WS-Addressing, WS-BP[.  .. ] More
    Web Services Platform Architecture(c) SOAP, WSDL, WS-Policy, WS-Addressing, WS-BP[. .. ] More
    ISBN: N/A
    EAN: N/A
    Year: 2005
    Pages: 176

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net