
616
|
Chapter 34: The System.Web.Services.Protocols Namespace
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Hierarchy
System.Object ➝ SoapMessage ➝ SoapClientMessage
SoapDocumentMethodAttribute
System.Web.Services.Protocols (system.web.services.dll)
sealed class
This attribute is used to specify the encoding for SOAP request and response messages.
You can apply this attribute to methods in a web service or in methods in a proxy class
that derives from SoapHttpClientProtocol (where it’s required to bind the messages to the
appropriate web method). You use this attribute, instead of SoapRpcMethodAttribute, when
you want to use the Document encoding standard.
There are two options for encoding XML information in a SOAP message: RPC and
Document. ASP.NET’s default is Document. The Document style specifies that
messages are encoded as described in an XSD schema. When Document style is used,
the WSDL document defines the XSD schemas for SOAP requests and SOAP
responses. For more information on the SOAP specification, see http://www.w3.org/
TR/SOAP/.
One reason you might want to apply this attribute to a web method is to explicitly set
the OneWay property. For example, by adding [SoapDocumentMethod(OneWay = true)] before a
web method, you ensure that the method will return immediately and can finish
processing asynchronously. This ensures ...