We've posted a new article
, excerpted from Professional ASP.NET 2.0 XML
by Thiru Thangarathinam. I think this will be of some interest in this XML forum.
Using SOAP Headers with ASP.NET 2.0 Web Services
When you communicate with a Web service using SOAP, the SOAP message that is sent to the Web service follows a standard format. The XML document inside the SOAP message is structured into two main parts: the optional headers and the mandatory body. The Body element comprises the data specific to the message. The optional Header element can contain additional information not directly related to the particular message. Each child element of the Header element is called a SOAP header.
SOAP headers are also a good place to put optional information, and a good means to supporting evolving interfaces. For example, imagine your bank allows you to manage multiple accounts with one ATM card. If you use your bank's ATM, you now have to specify if you want the withdrawal to be made from my primary, secondary, or tertiary account. If you use an ATM from another bank that isn't affiliated with you bank, you do not get asked that question. So the account identifier is clearly an optional parameter, with a reasonable default.
ASP.NET provides a mechanism for defining and processing SOAP headers. You can define a new SOAP header by deriving from the SoapHeader class. After you define a SOAP header, you can then associate the header with a particular endpoint within the Web service by using the SoapHeader attribute. Table 1 lists the properties exposed by the SoapHeader class.
You can read the complete article here
Senior Acquisitions Editor
Wiley Technology Publishing
Jim's Book of the week: No book this week - Donate to the Red Cross!