Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

WSDL Binding

WSDL Binding


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


Binding to SOAP

An example of a request - response operation:

Example

<

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

"

/>

operation

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

"

/>

<

input

<

soap:body

use

=

"

literal

"

/>

input

<

output

<

soap:body

use

=

"

literal

"

/>

output

operation

binding

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

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

soap:binding The element has two attributes - the style attribute and the transport attribute.

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

operation The element defines the operators provided by each port.

For each operation the corresponding SOAP action must be defined. You must also define how input and output are encoded. In this example we use "literal".