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:
. 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 address element attributes:
| Attribute Name | Description | Mandatory | Example |
|---|---|---|---|
| location | A URL which specifies the connectivity information to connect to the HTTP server | Yes | http://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 element attributes:
| Attribute Name | Description | Mandatory | Example |
|---|---|---|---|
| verb | Indicates which transport of HTTP this binding corresponds to | Yes | GET |
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.
HTTP operation element attributes:
| Attribute Name | Description | Mandatory | Example |
|---|---|---|---|
| location | Indicates the relative URI. Combined with the address location attribute | Yes | o1 |
<definitions .... >
<binding .... >
<operation .... >
<soap:operation location="uri" />
</operation>
</binding>
</definitions>
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.
HTTP urlEncoded element attributes:
| Attribute Name | Description | Mandatory | Example |
|---|
<definitions .... >
<binding .... >
<operation .... >
<input .... >
<http:urlEncoded/>
</input>
<output .... >
<-- mime elements -->
</output>
</operation>
</binding>
</definitions>
Message parts MUST NOT have repeating values.
HTTP urlReplacement element attributes:
| Attribute Name | Description | Mandatory | Example |
|---|
<definitions .... >
<binding .... >
<operation .... >
<input .... >
<http:urlReplacement/>
</input>
<output .... >
<-- mime elements -->
</output>
</operation>
</binding>
</definitions>
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
<definitions .... >
<message name="m1">
<part name="part1" type="xsd:string"/>
<part name="part2" type="xsd:int"/>
<part name="part3" type="xsd:string"/>
</message>
<message name="m2">
<part name="image" type="xsd:binary"/>
</message>
<portType name="pt1">
<operation name="o1">
<input message="tns:m1"/>
<output message="tns:m2"/>
</operation>
</portType>
<service name="service1">
<port name="port1" binding="tns:b1">
<http:address location="http://example.com/"/>
</port>
<port name="port2" binding="tns:b2">
<http:address location="http://example.com/"/>
</port>
<port name="port3" binding="tns:b3">
<http:address location="http://example.com/"/>
</port>
</service>
<binding name="b1" type="pt1">
<http:binding verb="GET"/>
<operation name="o1">
<http:operation location="o1/A(part1)B(part2)/(part3)"/>
<input>
<http:urlReplacement/>
</input>
<output>
<mime:content type="image/gif"/>
<mime:content type="image/jpeg"/>
</output>
</operation>
</binding>
<binding name="b2" type="pt1">
<http:binding verb="GET"/>
<operation name="o1">>
<http:operation location="o1"/>
<input>
<http:urlEncoded/>
</input>
<output>
<mime:content type="image/gif"/>
<mime:content type="image/jpeg"/>
</output>
</operation>
</binding>
<binding name="b3" type="pt1">
<http:binding verb="POST"/>
<operation name="o1">
<http:operation location="o1"/>
<input>
<mime:content type="application/x-www-form-urlencoded"/>
</input>
<output>
<mime:content type="image/gif"/>
<mime:content type="image/jpeg"/>
</output>
</operation>
</binding>
</definitions>
The HTTP GET/POST Binding extends WSDL with the following extension elements:
<definitions .... >
<binding .... >
<http:binding verb="nmtoken"/>
<operation .... >
<http:operation location="uri"/>
<input .... >
<-- mime elements -->
</input>
<output .... >
<-- mime elements -->
</output>
</operation>
</binding>
<port .... >
<http:address location="uri"/>
</port>
</definitions>