Index Changes

HTTP Binding WSDL Extensibility Elements

The HTTP extensibility elements describe interactions between a Web Browser and a web site through HTTP 1.1's GET and POST verbs. This allows applications other than Web Browsers to interact with the site. The following protocol specific information may be specified:

  • An indication that a binding uses HTTP GET or POST
  • An address for the port
  • A relative address for each operation (relative to the base address defined by the port)

Most of this information is derived directly from Section 4 of the WSDL 1.1 Specification. The information here is broken up into two main sections--how the user may configure an endpoint to an HTTP service and how the user specifies configuration to map WSDL messages to HTTP messages

HTTP Connectivity

The HTTP address extensibily element allows the user to specify the connectivity information to the HTTP server.

HTTP address element attributes:

Attribute NameDescriptionMandatoryExample
locationA URL which specifies the connectivity information to connect to the HTTP serverYeshttp://myhost:7676/some/additional/context

The following is a sample usage of the HTTP address extensibility element defined for a service port,

<port binding="y:binding" name="soapEndpoint">
   <http:address location="http://myhost:7676/some/additional/context" />
</port>

Notes on location


HTTP Binding

The HTTP extensibility elements for binding abstract WSDL messages to HTTP messages fall into several sections. Each section signifies how the binding should occur. At the binding level, the configuration applies to the entire port type. At the operation level, the configuration applies only to the operation. At the message level, the configuration applies to that particular message, whether it's input or output.

The HTTP binding Element

The purpose of the HTTP binding element is to signify that the binding is bound to the HTTP protocol.

HTTP binding element attributes:

Attribute NameDescriptionMandatoryExample
verbIndicates which transport of HTTP this binding corresponds toYesGET

The binding element MUST be present when using the HTTP binding.

<definitions .... >
    <binding .... >
        <http:binding verb="nmtoken" />
    </binding>
</definitions>

Notes on verb: The value of the required verb attribute indicates the HTTP verb. Common values are GET or POST, but others may be used. Note that HTTP verbs are case sensitive.

The HTTP operation Element

The purpose of the HTTP operation element is to provide binding information from the abstract operation to the concrete http operation.

HTTP operation element attributes:

Attribute NameDescriptionMandatoryExample
locationIndicates the relative URI. Combined with the address location attributeYeso1
&lt;definitions .... &gt;
    &lt;binding .... &gt;
        &lt;operation .... &gt;
           &lt;soap:operation location="uri" /&gt;
        &lt;/operation&gt;
    &lt;/binding&gt;
&lt;/definitions&gt;

Notes on location: The location attribute specifies a relative URI for the operation. This URI is combined with the URI specified in the http:address element to form the full URI for the HTTP request. The URI value MUST be a relative URI.

The HTTP urlEncoded Element

The urlEncoded element indicates that all the message parts are encoded into the HTTP request URI using the standard URI-encoding rules (name1=value&name2=value...). The names of the parameters correspond to the names of the message parts. Each value contributed by the part is encoded using a name=value pair. This may be used with GET to specify URL encoding, or with POST to specify a FORM-POST. For GET, the "?" character is automatically appended as necessary.

HTTP urlEncoded element attributes:

Attribute NameDescriptionMandatoryExample
&lt;definitions .... &gt;
    &lt;binding .... &gt;
        &lt;operation .... &gt;
           &lt;input .... &gt;
               &lt;http:urlEncoded/&gt;
           &lt;/input&gt;
           &lt;output .... &gt;
               &lt;-- mime elements --&gt;
           &lt;/output&gt;
        &lt;/operation&gt;
    &lt;/binding&gt;
&lt;/definitions&gt;

The HTTP urlReplacement Element

The urlReplacement element indicates that all the message parts are encoded into the HTTP request URI using a replacement algorithm:
  • The relative URI value of http:operation is searched for a set of search patterns.
  • The search occurs before the value of the http:operation is combined with the value of the location attribute from http:address.
  • There is one search pattern for each message part. The search pattern string is the name of the message part surrounded with parenthesis "(" and ")".
  • For each match, the value of the corresponding message part is substituted for the match at the location of the match.
  • Matches are performed before any values are replaced (replaced values do not trigger additional matches).

Message parts MUST NOT have repeating values.

HTTP urlReplacement element attributes:

Attribute NameDescriptionMandatoryExample
&lt;definitions .... &gt;
    &lt;binding .... &gt;
        &lt;operation .... &gt;
           &lt;input .... &gt;
               &lt;http:urlReplacement/&gt;
           &lt;/input&gt;
           &lt;output .... &gt;
               &lt;-- mime elements --&gt;
           &lt;/output&gt;
        &lt;/operation&gt;
    &lt;/binding&gt;
&lt;/definitions&gt;


HTTP GET/POST Examples

Example 1 -- How three ports are bound differently for a given port type.

If the values being passed are part1=1, part2=2, part3=3, the request format would be as follows for each port:

port1: GET, URL="http://example.com/o1/A1B2/3" port2: GET, URL="http://example.com/o1?p1=1&p2=2&p3=3 port3: POST, URL="http://example.com/o1", PAYLOAD="p1=1&p2=2&p3=3"

For each port, the response is either a GIF or a JPEG image.

GET and FORM POST returning GIF or JPG

&lt;definitions .... &gt;
    &lt;message name="m1"&gt;
        &lt;part name="part1" type="xsd:string"/&gt;
        &lt;part name="part2" type="xsd:int"/&gt;
        &lt;part name="part3" type="xsd:string"/&gt;
    &lt;/message&gt;

    &lt;message name="m2"&gt;
        &lt;part name="image" type="xsd:binary"/&gt;
    &lt;/message&gt;

    &lt;portType name="pt1"&gt;
        &lt;operation name="o1"&gt;
           &lt;input message="tns:m1"/&gt;
           &lt;output message="tns:m2"/&gt;
        &lt;/operation&gt;
    &lt;/portType&gt;

    &lt;service name="service1"&gt;
        &lt;port name="port1" binding="tns:b1"&gt;
           &lt;http:address location="http://example.com/"/&gt;
        &lt;/port&gt;
        &lt;port name="port2" binding="tns:b2"&gt;
           &lt;http:address location="http://example.com/"/&gt;
        &lt;/port&gt;
        &lt;port name="port3" binding="tns:b3"&gt;
             &lt;http:address location="http://example.com/"/&gt;
        &lt;/port&gt;
    &lt;/service&gt;

    &lt;binding name="b1" type="pt1"&gt;
        &lt;http:binding verb="GET"/&gt;
        &lt;operation name="o1"&gt;
           &lt;http:operation location="o1/A(part1)B(part2)/(part3)"/&gt;
           &lt;input&gt;
               &lt;http:urlReplacement/&gt;
           &lt;/input&gt;
           &lt;output&gt;
               &lt;mime:content type="image/gif"/&gt;
               &lt;mime:content type="image/jpeg"/&gt;
           &lt;/output&gt;
        &lt;/operation&gt;
    &lt;/binding&gt;

    &lt;binding name="b2" type="pt1"&gt;
        &lt;http:binding verb="GET"/&gt;
        &lt;operation name="o1"&gt;&gt;
           &lt;http:operation location="o1"/&gt;
           &lt;input&gt;
               &lt;http:urlEncoded/&gt;
           &lt;/input&gt;
           &lt;output&gt;
               &lt;mime:content type="image/gif"/&gt;
               &lt;mime:content type="image/jpeg"/&gt;
           &lt;/output&gt;
        &lt;/operation&gt;
    &lt;/binding&gt;

    &lt;binding name="b3" type="pt1"&gt;
        &lt;http:binding verb="POST"/&gt;
        &lt;operation name="o1"&gt;
           &lt;http:operation location="o1"/&gt;
           &lt;input&gt;
               &lt;mime:content type="application/x-www-form-urlencoded"/&gt;
           &lt;/input&gt;
           &lt;output&gt;
               &lt;mime:content type="image/gif"/&gt;
               &lt;mime:content type="image/jpeg"/&gt;
           &lt;/output&gt;
        &lt;/operation&gt;
    &lt;/binding&gt;
&lt;/definitions&gt;

Example 2 -- How the HTTP GET/POST Binding Extends WSDL

The HTTP GET/POST Binding extends WSDL with the following extension elements:

&lt;definitions .... &gt;
    &lt;binding .... &gt;
        &lt;http:binding verb="nmtoken"/&gt;
        &lt;operation .... &gt;
           &lt;http:operation location="uri"/&gt;
           &lt;input .... &gt;
               &lt;-- mime elements --&gt;
           &lt;/input&gt;
           &lt;output .... &gt;
               &lt;-- mime elements --&gt;
           &lt;/output&gt;
        &lt;/operation&gt;
    &lt;/binding&gt;

    &lt;port .... &gt;
        &lt;http:address location="uri"/&gt;
    &lt;/port&gt;
&lt;/definitions&gt;

JSPWiki v2.4.100
[RSS]
« Home Index Changes Prefs
This page (revision-2) was last changed on 30-Jan-07 10:11 AM, -0800 by 64.47.121.98