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

Re: HTTP Binding example for the Primer

From: Arthur Ryman <ryman@ca.ibm.com>
Date: Fri, 8 Apr 2005 23:37:16 -0400
To: "David Orchard" <dorchard@bea.com>
Cc: www-ws-desc@w3.org, www-ws-desc-request@w3.org
Message-ID: <OF9217970A.4AC7A997-ON85256FDD.0080ABDB-85256FDE.0013E2B8@ca.ibm.com>

Great examples. Would you like to contribute them to the Test Suite? If 
so, please split these up into XSD valid files and post them to the 
mailing list. I'll extract them and check them into the Test Suite.

Arthur Ryman,
Rational Desktop Tools Development

phone: +1-905-413-3077, TL 969-3077
assistant: +1-905-413-2411, TL 969-2411
fax: +1-905-413-4920, TL 969-4920
mobile: +1-416-939-5063, text: 4169395063@fido.ca
intranet: http://labweb.torolab.ibm.com/DRY6/

"David Orchard" <dorchard@bea.com> 
Sent by: www-ws-desc-request@w3.org
03/31/2005 07:15 PM


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 there.
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 
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 endpoints. 
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"
            whttp:location="/ConfirmationNumber/{confirmationNumber/}" />
        <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" minOccurs="0"/>
                <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 Saturday, 9 April 2005 03:37:25 UTC

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