Apply this attribute to a class to provide the methods necessary for handling SOAP method calls and exposing information about the services offered by this class through WSDL.
[ soap_handler( name, namespace, protocol, style, use ) ]
- name (optional)
- A string specifying the name of the XML Web service. If not specified, "Service" is appended to the name of the class and used as the name in the WSDL description of the service.
- namespace (optional)
- A string specifying the XML namespace to be used to uniquely identify the service, methods, and data types. If not specified, the name of the class is used.
- protocol (optional)
- A string specifying the protocol by which this XML Web service can be accessed. The only supported value is "soap", which is assumed if not specified.
- style (optional)
- A string specifying the style of operations provided by the XML Web service. Corresponds to the wsdl:style XML attribute. The only supported values are "document" and "rpc". If no value is specified, "rpc" is used.
- use (optional)
- A string specifying whether the WSDL message parts should be encoded or define a concrete schema. Corresponds to the wsdl:use XML attribute. The only supported values are "literal" and "encoded". If no value is specified, "encoded" is used.
Note that style and use are only supported in the following combinations:
style = "rpc", use = "encoded" style = "document", use = "literal"
|Applies to||coclass, class, struct|
For more information about the attribute contexts, see Attribute Contexts.
For more information about the meaning of the requirements, see Attribute Requirements.
To create a fully functional XML Web service, you must apply the request_handler attribute to the same class. soap_handler provides the functionality for parsing XML SOAP requests and dispatching the calls to the appropriate methods. request_handler provides the functionality to expose the XML Web service as an ATL Server request handler that can handle SOAP method calls through HTTP.
Use the soap_method attribute on any methods of this class that you want to expose as methods of the XML Web service. Use the soap_header attribute on SOAP methods where you want to obtain or attach the value of one or more SOAP headers.
The values specified by the parameters of the soap_handler attribute will be used in the generated WSDL description of the XML Web service.
To expose the XML Web service description using a request handler, specify the name of the handler that the compiler should generate for this task using the sdl parameter of the request_handler attribute.
Note that the compiler-generated handler that returns the WSDL relies on an instance of the main SOAP handler class to provide it with the information necessary to create its response. When generating its response, it will create an instance of your class on the stack in order to get the information about the SOAP methods and SOAP headers, so it's important that your class does not do any heavy initialization in the constructor or assume that it will only be created when being used to handle SOAP requests.
The response generated by the WSDL handler will be cached in release builds, so the SOAP handler will only be created by the WSDL handler the first time that the XML Web service description is requested.
See request_handler for details of the base classes injected by this attribute.
See the following examples:
- SOAP Server Code
- MantaWeb Sample
- DataSetConsumer Sample
- OnlineAddressBook Sample
- SOAPDataTypes Sample
- SOAPTransport Sample
- WeatherService Sample