This keyword specifies the name of the top element in the SOAP body of the request message, for wrapped document/literal messages. (Wrapped document/literal messages are the default. For information, see Examples of Message Variations in Creating Web Services and Web Clients.)
Relationship to WSDL
The SoapRequestMessage keyword affects the <message> sections of the WSDL for the web service. For example, consider the following web method:
Method Add(a as %Numeric,b as %Numeric) As %Numeric [ SoapAction = MyAct,SoapRequestMessage=MyReqMessage, WebMethod ]
{
Quit a + b
}
For this web service, the WSDL includes the following:
<message name="AddSoapIn">
<part name="parameters" element="s0:MyReqMessage"/>
</message>
<message name="AddSoapOut">
<part name="parameters" element="s0:AddResponse"/>
</message>
These elements are correspondingly defined in the <types> section.
By default, if the method did not specify the SoapRequestMessage keyword, the <message> sections would instead be like the following:
<message name="AddSoapIn">
<part name="parameters" element="s0:Add"/>
</message>
<message name="AddSoapOut">
<part name="parameters" element="s0:AddResponse"/>
</message>
If you use the SOAP Wizard to generate an InterSystems IRIS web service service or client from a WSDL, InterSystems IRIS sets this keyword as appropriate for that WSDL.
Effect on the Message
For the web method shown previously, the web service expects a request message of the following form:
<?xml version="1.0" encoding="UTF-8" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:s='http://www.w3.org/2001/XMLSchema'>
<SOAP-ENV:Body>
<MyReqMessage xmlns="http://www.myapp.org"><a>1</a><b>2</b></MyReqMessage>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
In contrast, if the method did not specify the SoapRequestMessage keyword, the message would instead be like the following:
<?xml version="1.0" encoding="UTF-8" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:s='http://www.w3.org/2001/XMLSchema'>
<SOAP-ENV:Body>
<Add xmlns="http://www.myapp.org"><a>1</a><b>2</b></Add>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>