W3C home > Mailing lists > Public > www-ws-desc@w3.org > April 2005

RE: HTTP Binding example for the Primer

From: Liu, Kevin <kevin.liu@sap.com>
Date: Fri, 1 Apr 2005 02:18:50 +0200
Message-ID: <99CA63DD941EDC4EBA897048D9B0061D129D5C9B@uspalx20a.pal.sap.corp>
To: "David Orchard" <dorchard@bea.com>, <www-ws-desc@w3.org>
Hi David,
Thanks a lot for the contribution. Don't worry about the XML format, I
will doing the formating and incorporate it into the primer.

Best Regards,



From: www-ws-desc-request@w3.org [mailto:www-ws-desc-request@w3.org] 
Sent: Thursday, Mar 31, 2005 4:15 PM
To: www-ws-desc@w3.org
Subject: HTTP Binding example for the Primer

I've created a bunch of examples for the Primer.  A checkAvailability
GET, ReservationDetails GET and PUT, and 2 forms of ReservationList GET.
This shows GETs and PUTs, as well as using a query type for use in a
URI.  My apologies for not putting this into xml-spec nor providing
perhaps the most complete examples or text, but at least the content is


4.3.3 Extensions for  HTTP Binding


As mentioned in section 2.5, WSDL 2.0 offers great flexibility in
binding to SOAP message formats as well as HTTP.  The GreatH service can
be deployed to HTTP such that an HTTP GET can return the flight
availability, as shown below:


  <binding name="reservationHTTPBinding" 




  <operation ref="tns:opCheckAvailability"

    whttp:location="{tCheckAvailability}"  >




  <service name="reservationService" 



    <!-- HTTP 1.1 GET End Point -->

    <endpoint name="reservationEndpoint" 





The default Binding Rules for HTTP specify that the default input
serialization for GET is application/x-www-form-urlencoded.  A sample
URI is

omType=foo> &checkOutDate=6-6-5&roomType=foo


Each of the elements in the tCheckAvailability type is serialized into
the query parameters.


It is also possible to serialize a subset of the tCheckAvailability type
by using appending a "/" in the whttp:location, as in:


<operation ref="tns:opCheckAvailability"

    whttp:location="bycheckInDate/{checkInDate/}"  >


This serializes to http://greath.example.com/2004/bycheckInDate/5-5-5.  


5.11.3 Reservation Details Web Service using HTTP transfer


As each reservation has a distinct URI, the Reservation Details Web
service can be offered using HTTP GET and HTTP PUT.


<binding name="reservationDetailsHTTPBinding"



        <operation ref="tns:retrieve"

            whttp:method="GET" />


        <operation ref="tns:update"

            whttp:method="PUT" />




As with the earlier examples, a service and endpoint elements are not
provided because the reservation List Web service provides the


5.11.4 Reservation List Web service using HTTP GET


The SOAP version of the Reservation List offers 4 different search
operations.  These can also be expressed as various parameters in a URI
used by HTTP Get.


<binding name="reservationListHTTPBinding"




        <operation ref="tns:retrieve"

            whttp:location="" />


        <operation ref="tns:retrieveByConfirmationNumber"



        <operation ref="tns:retrieveByCheckInDate"

            whttp:location="/CheckInDate/{checkInDate/}" />


        <operation ref="tns:retrieveByCheckOutDate"

            whttp:location="/CheckOutDate/{checkOutDate/}" />




    <endpoint name="reservationListEndpoint"


            address="http://greath.example.com/2004/reservationList" />



A retrieval by Confirmation Number URI would look like



Alternatively, a single Query type may be provided.  This query type is
a sequence of optional items.  Any items in the sequence are serialized
into the URI query string.  A query sequence for any of
ConfirmationNumber, checkInDate, checkOutDate is


<element name="reservationQuery">



                A reservation contains the confirmation number, check-in

                and check-out dates, and a reference to a Reservation

                Details Web service.





                <element ref="details:confirmationNumber"

                <element ref="details:checkInDate" minOccurs="0"/>/>

                <element ref="details:checkOutDate" minOccurs="0"/>/>






The WSDL service that offers this type serialized as a parameter is:


<interface name="reservationListInterfaceWithQuery">


        <operation name="retrieveByReservationQuery"


            <input messageLabel="In"

                element="details:ReservationQuery" />

            <output messageLabel="Out" element="list:reservationList" />





<binding name="reservationListQueryHTTPBinding"




        <operation ref="tns:retrieveByReservationQuery"

            whttp:location="/{ReservationQuery}}" />




    <endpoint name="reservationListEndpoint"


            address="http://greath.example.com/2004/reservationList" />



Various URIs are




It is important to observe that using the URI serialization can result
in very flexible queries and few operations.  The previous discrete SOAP
operations are collapsed into one "parameterized" operation.



Received on Friday, 1 April 2005 00:19:05 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:06:49 UTC