Working with a SoapContext

Started by thiruvasagamani, Mar 09, 2009, 05:16 PM

Previous topic - Next topic

thiruvasagamani

Working with a SoapContext

The SoapContext class provides access to the WS-Security, routing capability, and DIME SOAP headers associated with a SOAP message. When a Web service and client are communicating two ways, there is a SoapContext for both the SOAP requests and SOAP responses.

WSE allows a Web service client to send SOAP messages to a computer running a WSE router. Based on the information in its referral cache, the WSE router can transparently reroute the SOAP message to another computer to process the message. The WSE router can be useful when a Web server needs to be taken offline for maintenance and you do not want to update all the client applications.
Getting the SoapContext in a Client Application

    * To use WSE in a Web service client application, the proxy class inherits from the WebServicesClientProtocol class, and then accesses one of the following properties of the proxy class to get the SoapContext class:
    * The RequestSoapContext property for the SOAP request.
    * The ResponseSoapContext property for the SOAP response.

Nearly all client applications that use WSE will access the RequestSoapContext property, and a much smaller percentage will access the ResponseSoapContext property.

The following code example demonstrates a proxy class named Service1 that has been modified to derive from WebServicesClientProtocol.
Visual Basic
Copy Code

Public Class Service1
   Inherits Microsoft.Web.Services2.WebServicesClientProtocol



Source :MSDN
Thiruvasakamani Karnan