The following sections describe how the HTTP Binding Component supports and implements the HTTP Binding language elements. Unless indicated otherwise, each of the WSDL elements described below are defined in the namespace http://schemas.xmlsoap.org/wsdl/http/.
The <http:binding> element:
Indicates that the binding uses the HTTP protocol.
Must be specified as a subordinate element of a <wsdl:binding>
Currently the HTTP Binding Component only supports GET and POST values (please note that HTTP methods are case-sensitive).
Example:
<http:binding verb="POST"/> |
The <http:address> element:
Represents the address of the port.
Must be specified as a subordinate element of a <wsdl:port>
Requires a location attribute that specifies the base URI for the port.
Example:
<http::address location="http://localhost/MyService/MyPort"/> |
The <http:operation> element:
Represents an address for an operation.
Must be specified as a subordinate element of a <wsdl:operation/>
Requires a location attribute that specifies the base URI for the operation.
The full URI for a request to this port and to this specific operation. The <http:address> element addresses the port, and since a port can have multiple operations, this element represents a relative address to a particular operation; the value of this element's location attribute is appended to the value of the<http:address> location attribute to form the full URI for a request to this port and to this specific operation.
The HTTP Binding Component supports a blank location attribute value for this element.
Example:
Given: <http:operation location="Submit"> <http:address location="http://localhost/MyService/MyPort"> The full HTTP request URI is: http://localhost/MyService/MyPort/Submit |
The <http:urlEncoded> element:
Indicates that all message parts that make up the input message are encoded into the request URI using query-string encoding, as follows:
Name-value pair formatted as name=value
Ampersand-delimited name-value pairs:name1=value1&name2=value2&...
Message part names comprise the names in each pair, and message part values comprise the values in each pair.
Must be specified as a subordinate element of a <wsdl:input/>
Requires a location attribute that specifies the base URI for the operation.
Is only supported by the HTTP Binding Component for the GET method. <http:urlEncoded> is ignored for the POST method. For more information, see POST URL Processing of the HTTP WSDL Binding Implementation.
Example:
Given this description: <wsd:message name="MyMessage"> <wsdl:part name="partA" type="xsd:string"/> <wsdl:part name="partB" type="xsd:string"/> </wsdl:message> ... <wsdl:portType name="MyPortType"> <wsdl:operation name="MyOperation"> <wsdl:input message="MyMessage"/> </wsdl:operation> </wsdl:portType> ... <wsdl:binding name="MyBinding" type="MyPortType"> <http:binding verb="GET"/> <wsdl:operation name="MyOperation"> <wsdl:input> <http:urlEncoded/> </wsdl:input> </wsdl:operation> </wsdl:binding> ... <wsdl:service name="MyService"> <wsdl:port name="Port1" binding="MyBinding"> <http:address location="http://localhost/MyService/MyPort"/> </wsdl:port> </wsdl:service> Given these values mapped to the input parts: "valueY" -> "partA" "valueZ" -> "partB" The full HTTP request URI is: http://localhost/MyService/MyPort/MyOperation/partA=valueY&partB=valueZ |
The <http:urlReplacement/> element:
Indicates that all message parts that make up the input message are encoded into the request URI using the replacement algorithm detailed in the WSDL 1.1 Specification.
Must be specified as a subordinate element of a <wsdl:input/>
Requires a location attribute that specifies the base URI for the operation.
Is only supported by the HTTP Binding Component for the GET method. <http:urlEncoded> is ignored for the POST method. For more information, see POST URL Processing of the HTTP WSDL Binding Implementation.
Example:
Given this description: <wsd:message name="MyMessage"> <wsdl:part name="partA" type="xsd:string"/> <wsdl:part name="partB" type="xsd:string"/> </wsdl:message> ... <wsdl:portType name="MyPortType"> <wsdl:operation name="MyOperation"> <wsdl:input message="MyMessage"/> </wsdl:operation> </wsdl:portType> ... <wsdl:binding name="MyBinding" type="MyPortType"> <http:binding verb="GET"/> <wsdl:operation name="MyOperation/(partA)/subcategory/(partB)"> <wsdl:input> <http:urlReplacement/> </wsdl:input> </wsdl:operation> </wsdl:binding> ... <wsdl:service name="MyService"> <wsdl:port name="Port1" binding="MyBinding"> <http:address location="http://localhost/MyService/MyPort"/> </wsdl:port> </wsdl:service> Given these values mapped to the input parts: "valueY" -> "partA" "valueZ" -> "partB" The full HTTP request URI is: http://localhost/MyService/MyPort/MyOperation/valueY/subcategory/valueZ |