Caché Class Definition Reference
SoapBindingStyle
[Back] [Next]
   
Server:docs1
Instance:LATEST
User:UnknownUser
 
-
Go to:
Search:    

Specifies the binding style or SOAP invocation mechanism used by any web methods defined in this class. Applies only in a class that is defined as a web service or web client.
Usage
To specify the binding style used by any web methods defined in this class, use the following syntax:
Class MyApp.MyClass [ SoapBindingStyle = soapbindingstyle ] 
{
//class members
}
Where soapbindingstyle is one of the following:
If SoapBindingStyle is document and if ARGUMENTSTYLE is message, then the message style is very similar to RPC; see Creating Web Services and Web Clients in Caché.
Important:
For a web service that you create manually, the default value of this keyword is usually suitable. When you generate a web client or service from a WSDL with the SOAP Wizard, Caché sets this keyword as appropriate for that WSDL; if you modify the value, your web client or service may no longer work.
Details
This keyword lets you specify the default binding style used by any web methods defined in this class. It affects the format of the SOAP body (but not any SOAP headers).
You can override the binding style for individual methods, by using the SoapBindingStyle method keyword or the SoapBindingStyle query keyword.
Effect on Subclasses
This keyword is not inherited.
Default
The default value is document. (Chapter 7 of the SOAP standard v1.1, “Using SOAP for RPC,” specifies that web methods should use RPC-style binding. However, most SOAP clients, including .NET, use document-style binding.)
Relationship to WSDL
The SoapBindingStyle class keyword specifies the value of the style attribute of <soap:binding> element within the <binding> section of the WSDL. For example, if SoapBindingStyle is document, the WSDL could look as follows:
...
<binding ...>
    <soap:binding ... style="document"/>
    <operation ...>
        <soap:operation ... style="document"/>
...
As shown here, the SoapBindingStyle class keyword also specifies the default value of the style attribute of the <soap:operation> element, within the <binding> section of the WSDL; this attribute is further controlled by the SoapBindingStyle method keyword.
In contrast, if SoapBindingStyle is rpc, the WSDL could instead be as follows:
...
<binding ...>
    <soap:binding ... style="rpc"/>
    <operation ...>
        <soap:operation ... style="rpc"/>
...
The binding style also affects the <message> elements, as follows:
Effect on SOAP Messages
The primary effect on SOAP messages is to control whether the SOAP body can contain multiple subelements.
For a web method that uses a RPC-style binding and encoded-style messages, the following shows an example of the body of a possible request message:
<SOAP-ENV:Body SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
   <types:Add>
      <a href="#id1" /><b href="#id2" />
   </types:Add>
   <types:ComplexNumber id="id1" xsi:type="types:ComplexNumber">
      <Real xsi:type="s:double">10</Real>
      <Imaginary xsi:type="s:double">5</Imaginary>
   </types:ComplexNumber>
   <types:ComplexNumber id="id2" xsi:type="types:ComplexNumber">
      <Real xsi:type="s:double">17</Real>
      <Imaginary xsi:type="s:double">2</Imaginary>
   </types:ComplexNumber>
</SOAP-ENV:Body>
In contrast, the following shows an example of the body of a possible request message for a web method that uses literal binding and encoded-style messages:
<SOAP-ENV:Body>
   <tns:Add>
      <tns:a xsi:type="tns:ComplexNumber">
         <Real xsi:type="s:double">10</Real>
         <Imaginary xsi:type="s:double">5</Imaginary>
      </tns:a>
      <tns:b xsi:type="tns:ComplexNumber">
         <Real xsi:type="s:double">17</Real>
         <Imaginary xsi:type="s:double">2</Imaginary>
      </tns:b>
      </tns:Add>
</SOAP-ENV:Body>
In this case, the SOAP body has a single subelement.
Use With %XML.DataSet
For objects of type %XML.DataSet, not all permutations of the SoapBindingStyle and SoapBodyUse keywords are permitted, as the following table summarizes:
  SoapBodyUse=literal (default) SoapBodyUse=encoded
SoapBindingStyle=document(default) supported not supported
SoapBindingStyle=rpc supported supported
See Also