Adding a SOAP Extension

In essence, a SoapExtension class allows you to dig into the SOAP XML that .NET has produced or just received so that you can alter the contents or otherwise perform necessary processing. For example, with a SoapExtension, you might use XPath to extract a SOAP XML element, encrypt it, and return it to the XML stream before it leaves your computer. Or, when you receive a SOAP packet, you might scan the contents to see if additional resources will be required to process the request and, if so, marshal those resources in advance.

To create a SoapExtension, you derive a new class from SoapExtension and override the necessary virtual methods. To hook the extension into your Web methods, you also create a custom attribute based ...

Get Applied SOAP: Implementing .NET XML Web Services now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.