WSDL tutoriallogin
WSDL tutorial
author:php.cn  update time:2022-04-11 14:49:08

WSDL binding



WSDL binding defines the message format and protocol details for a web service.


Bind to SOAP

Example of a request-response operation:

<message name="getTermRequest">
​ <part name="term" type="xs:string"/>
</message>

<message name="getTermResponse">
​ <part name="value" type="xs:string"/>
</message>

<portType name="glossaryTerms">
​ <operation name="getTerm">
                               <input message="getTermRequest"/>
                                    ​ ​ ​ ​ <output message="getTermResponse"/>
                                                                                                            </portType>

<binding type="glossaryTerms" name="b1">
<soap:binding style="document"
transport="http://schemas .xmlsoap.org/soap/http" />
<operation>
         <soap:operation soapAction="http://example.com/getTerm"/>
                                                                                                                                                                                                                                                                                                                        ​ The </operation>
</binding>


binding
element has two attributes - the name attribute and the type attribute.

The name attribute defines the name of the binding, and the type attribute points to the port used for the binding, in this case the "glossaryTerms" port.

soap:binding

The element has two attributes - style attribute and transport attribute.

The style attribute can take the value "rpc" or "document". In this example we use document. The transport attribute defines the SOAP protocol to use. In this example we use HTTP. The

operation

element defines the operators provided by each port.

For each operation, the corresponding SOAP behavior needs to be defined. Also how you have to encode the input and output. In this example we use "literal".