SCDJWS Study Guide: WSDL
Printer-friendly version |
Mail this to a friend
WSDL Messaging Exchange Patterns
In WSDL, there are four basic message exchange patterns used in Web services: one-way, request-response, solicit-response, and notification.
One-way
The service receives a message. The operation therefore has a single input element.
<wsdl:definitions … >
<wsdl:portType … > *
<wsdl:operation name="nmtoken">
<wsdl:input name="nmtoken"? message="qname"/>
</wsdl:operation>
</wsdl:portType>
</wsdl:definitions>
Request-Response
The service receives a message and sends a response. The operation therefore has one input element, followed by one output element. To encapsulate errors, an optional fault element can also be specified.
<wsdl:definitions … >
<wsdl:portType … > *
<wsdl:operation name="nmtoken" parameterOrder="nmtokens">
<wsdl:input name="nmtoken"? message="qname"/>
<wsdl:output name="nmtoken"? message="qname"/>
<wsdl:fault name="nmtoken"? message="qname"/>*
</wsdl:operation>
</wsdl:portType>
</wsdl:definitions>
Solicit-Response
The service sends a message and receives a response. The operation therefore has one output element, followed by one input element. To encapsulate errors, an optional fault element can also be specified.
<wsdl:definitions …>
<wsdl:portType … > *
<wsdl:operation name="nmtoken" parameterOrder="nmtokens">
<wsdl:output name="nmtoken"? message="qname"/>
<wsdl:input name="nmtoken"? message="qname"/>
<wsdl:fault name="nmtoken"? message="qname"/>*
</wsdl:operation>
</wsdl:portType>
</wsdl:definitions>
Notification
The service sends a message. The operation therefore has a single output element.
<wsdl:definitions … >
<wsdl:portType … > *
<wsdl:operation name="nmtoken">
<wsdl:output name="nmtoken"? message="qname"/>
</wsdl:operation>
</wsdl:portType>
</wsdl:definitions>
Solicit-Response and Notification messaging are
supported by
WSDL, but they are not supported by the WS-I Basic Profile 1.0.
5.4.5 Allowed Operations
Solicit-Response and Notification
operations are not well defined by WSDL 1.1; furthermore, WSDL 1.1 does
not define bindings for them.
| R2303 | A DESCRIPTION MUST NOT use Solicit-Response and Notification type operations in a wsdl:portType definition. |