The Request-Response Pattern
The request-response operation includes one input element, which is the client’s request to the server, followed by one output element, which is the server’s response back to the client.
In WeatherSummary.wsdl, the request-response operation is defined by the subscribe and unsubscribe operations:
...
<operation name="subscribe">
<input message="tns:subscribe"/>
<output message="tns:subscribeResponse"/>
</operation>
<operation name="unsubscribe">
<input message="tns:subscribe"/>
<output message="tns:subscribeResponse"/>
</operation>
...
The operation subscribe contains an input message subscribe, which is the client request, and an output message subscribeResponse, which is the server response. The contents of these messages are then defined in the WSDL file’s message element:
<message name="subscribe">
<part name="host" type="xsd:string"/>
<part name="port" type="xsd:string"/>
<part name="transportName" type="xsd:string"/>
</message>
<message name="subscribeResponse">
<part name="status" type="xsd:boolean"/>
<part name="message" type="xsd:string"/>
</message>
The message subscribe contains three parts of type xsd:string that tell the service where and how to send messages.
The message subscribeResponse contains two parts, a status of type xsd:boolean indicating success or failure of the request, and a message string.
The implementation of this pattern occurs in the client-side WeatherSummaryClient.cpp, a sample implementation that uses the generated class in WeatherSummaryProxy.cpp, and in the server-side WeatherSummaryImp.cpp, the server implementation that receives the request and sends a response.
For more information on the request-response pattern, see the examples discussed in Part I, “Getting Started,” as well as those in
Part IV, Extending your Applications.