O'Reilly logo

Microsoft® Visual Basic® .NET Programmer's Cookbook by Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Log SOAP Messages with a SOAP Extension

Problem

You want to directly access or modify raw SOAP messages with .NET code.

Solution

Create a custom SOAP extension.

Discussion

ASP.NET allows you to access the raw SOAP messages that are transmitted to and from a Web service, but only by creating a special SOAP extension class. This class is triggered automatically as the SOAP message passes through the following four stages on the server:

  • SoapMessageStage.BeforeDeserialize occurs immediately after the Web server receives the SOAP request message.

  • SoapMessageStage.AfterDeserialize occurs after the raw SOAP message is translated to .NET data types but just before the Web method code runs.

  • SoapMessageStage.BeforeSerialize occurs after the Web method code runs ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required