
A binding element describes a specific communication protocol for a portType element. Each binding corresponds to a portType in the WSDL document. The binding element describes the specific protocol for each message in each operation of the portType element. A binding element may contain extension elements that provide information for the specific binding. The sample below shows the basic outline of a binding for a SOAP message:
<binding name="BindingName" type="PortTypeRef">
<soap:binding style="rpc|document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="OperationName">
<soap:operation soapAction="ActionValue"/>
<input>
<soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="TargetNamespace"
use="encoded"/>
</input>
<output>
<soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="TargetNamespace"
use="encoded"/>
</output>
</operation>
</binding>
The BindingName sets the name of the binding. The PortTypeRef refers to a portType defined elsewhere in the WSDL document. The PortTypeRef must be namespace qualified if the targetNamespace for the WSDL definitions element is not the same as the default namespace. The TargetNamespace is the targetNamespace for the WSDL document, or the default namespace for the document if no targetNamespace is set.
The OperationName sets the name of the operation this binding applies to. This name must match the name of an operation declared within the portType referenced in PortTypeRef. However, the OperationName is a declaration, not a reference, so the name need not be namespace qualified.
The sample below shows the binding defined in WeatherSummary.wsdl:
<binding name="WeatherSummary" type="tns:WeatherSummary">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getSummary">
<soap:operation soapAction="getSummary"/>
<input>
<soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.roguewave.com/webservices/examples"
use="encoded"/>
</input>
<output>
<soap:body
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://www.roguewave.com/webservices/examples"
use="encoded"/>
</output>
</operation>
</binding>
The type attribute of the binding element specifies that the element is a binding for the portType named WeatherSummary. Each level of the binding contains an element from the soap namespace. These elements define the binding from the parts in the portType to the parts of a SOAP message.
Each soap element provides information about the WSDL element that contains the soap element. The soap:binding element states that the operations in this binding use RPC-style SOAP transmitted via HTTP. The soap:operation element states that HTTP requests to the operation named getSummary must include a SoapAction HTTP header with the value getSummary. The soap:body elements state that the input and output messages defined in the portType form the contents of the body of a SOAP message.
The binding describes the specific format and transport protocol for each message. The binding does not, however, define a network address for the messages.
©2003-2005 Copyright Quovadx, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.