Skip to main content

CookieManagerMessageInspector

Maintains a copy of the cookies contained in the incoming HTTP response received from any service and appends it to all outgoing HTTP requests.

This class effectively allows to send any received HTTP cookies to different services, reproducing the same functionality available in ASMX Web Services proxies with the <xref href="System.Net.CookieContainer" data-throw-if-not-resolved="false"></xref> class. Based on http://megakemp.wordpress.com/2009/02/06/managing-shared-cookies-in-wcf/

Assembly: ServiceStack.Client.dll
View Source
Declaration
public class CookieManagerMessageInspector : IClientMessageInspector

Properties

Uri

View Source
Declaration
public string Uri { get; set; }

Instance

Gets the singleton ServiceStack.CookieManagerMessageInspector instance.

This class effectively allows to send any received HTTP cookies to different services, reproducing the same functionality available in ASMX Web Services proxies with the <xref href="System.Net.CookieContainer" data-throw-if-not-resolved="false"></xref> class. Based on http://megakemp.wordpress.com/2009/02/06/managing-shared-cookies-in-wcf/

View Source
Declaration
public static CookieManagerMessageInspector Instance { get; }

Methods

AfterReceiveReply(ref Message, Object)

Inspects a message after a reply message is received but prior to passing it back to the client application.

View Source
Declaration
public void AfterReceiveReply(ref Message reply, object correlationState)
Parameters
TypeNameDescription
System.ServiceModel.Channels.MessagereplyThe message to be transformed into types and handed back to the client application.

| | System.Object | correlationState | Correlation state data.

|

BeforeSendRequest(ref Message, IClientChannel)

Inspects a message before a request message is sent to a service.

View Source
Declaration
public object BeforeSendRequest(ref Message request, IClientChannel channel)
Returns

System.Object: <strong>Null</strong> since no message correlation is used.

Parameters
TypeNameDescription
System.ServiceModel.Channels.MessagerequestThe message to be sent to the service.

| | System.ServiceModel.IClientChannel | channel | The client object channel.

|

Implements

  • System.ServiceModel.Dispatcher.IClientMessageInspector