Caché Class Definition Reference
[Home] [Back] [Next]
InterSystems: The power behind what matters   

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.
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é.
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.
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.
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=''>
      <a href="#id1" /><b href="#id2" />
   <types:ComplexNumber id="id1" xsi:type="types:ComplexNumber">
      <Real xsi:type="s:double">10</Real>
      <Imaginary xsi:type="s:double">5</Imaginary>
   <types:ComplexNumber id="id2" xsi:type="types:ComplexNumber">
      <Real xsi:type="s:double">17</Real>
      <Imaginary xsi:type="s:double">2</Imaginary>
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:
      <tns:a xsi:type="tns:ComplexNumber">
         <Real xsi:type="s:double">10</Real>
         <Imaginary xsi:type="s:double">5</Imaginary>
      <tns:b xsi:type="tns:ComplexNumber">
         <Real xsi:type="s:double">17</Real>
         <Imaginary xsi:type="s:double">2</Imaginary>
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

Send us comments on this page
Copyright © 1997-2019 InterSystems Corporation, Cambridge, MA