Messages with Multiple Parts
Messages may contain multiple parts. Here is an excerpt from the WeatherSummary example’s WSDL file. Each message contains multiple parts that define simple-type data:
<message name="subscribe">
<part name="host" type="xsd:string"/>
<part name="port" type="xsd:string"/>
<part name="transportName" type="xsd:string"/>
<message name="subscribeResponse">
<part name="status" type="xsd:boolean"/>
<part name="message" type="xsd:string"/>
In this case, the generated service operation methods simply instantiate multiple simple-type objects representing the input and output parameters to the operation, and then pass them to the proxy. On the client side, the generated service operation method in WeatherSummaryClient.cpp looks like this:
void invoke_subscribe(WeatherSummaryProxy& proxy)
std::string host_in;
std::string port_in;
std::string transportName_in;
bool status_out;
std::string message_out;
rwsf::CallInfo callInfo;
proxy.subscribe(callInfo, host_in,
port_in, transportName_in,
status_out, message_out);
Likewise, on the server side, the signature of the generated code’s service operation method takes these input and output messages as its parameters:
WeatherSummaryImp::subscribe(rwsf::CallInfo& callInfo,
const std::string& host_in,
const std::string& port_in,
const std::string& transportName_in,
bool& status_out,
std::string& message_out)
Note that the return type is the part type when the response message has one part, and void when the response message has multiple parts. In this case, the response parts are given as reference parameters. All parameters have _in or _out appended to their names to signify whether they represent request or response parts.