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

Specifies the XML namespace for the types used by this web method. Applies only in a class that is defined as a web service or web client.
Usage
To override the default XML namespace for the types (when the method is used as a web method), use the following syntax:
Method name(formal_spec) As returnclass [ SoapTypeNameSpace = "soapnamespace", SoapBindingStyle = document, WebMethod ]
{
   //implementation
}
Where soapnamespace is a namespace URI. Note that if the URI includes a colon (:), the string must be quoted. That is, you can use the following:
Method MyMethod() [ SoapTypeNameSpace = "http://www.mynamespace.org", SoapBindingStyle = document, WebMethod ] 
Or the following:
Method MyMethod() [ SoapTypeNameSpace = othervalue, SoapBindingStyle = document, WebMethod ] 
But not the following:
Method MyMethod() [ SoapTypeNameSpace = http://www.mynamespace.org, SoapBindingStyle = document, WebMethod ] 
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 a 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 specifies the XML namespace for the types used by this web method. For details, see Creating Web Services and Web Clients in Caché.
Note:
This keyword has an effect only if the method uses document-style binding. That is, the method (or the class that contains it) must be marked with SoapBindingStyle equal to document. (It is meaningless to specify this keyword for a method that uses rpc-style binding.)
Default
If you omit this keyword, the types for this method are in the namespace specified by the TYPENAMESPACE parameter of the web service or client class. If TYPENAMESPACE is not specified, the types are instead in the namespace specified by the NAMESPACE parameter of the web service or client.
Relationship to WSDL
The SoapTypeNameSpace keyword affects the following parts of the WSDL:
Effect on Messages
A possible SOAP message might look as follows (with line breaks and spaces added for readability):
<?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>
      <AddResponse xmlns="http://www.customtypes.org">
         <AddResult>3</AddResult>
      </AddResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Notice that the <AddResponse> element is in the "http://www.customtypes.org" namespace.
In contrast, if we did not specify the SoapTypeNameSpace keyword, the message could be as follows instead:
<?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>
      <AddResponse xmlns="http://www.webservicetypesns.org">
         <AddResult>3</AddResult>
      </AddResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
See Also