Passing additional HTTP headers over .NET Remoting hosted in IIS

Passing additional HTTP headers over .NET Remoting hosted in IIS

Old forum URL: forums.lhotka.net/forums/t/3421.aspx


ktweedy posted on Friday, August 24, 2007

Hi,

To support an authentication system we have call siteMinder which is an ISAPI filter on our webservice I need to be able to pass a token in the header of the HTTP request that .NET romoting uses with it performs the call to the DLL on the server.

Anyone know how to do this?

I ma using the Remoting proxy and have .NET Remoting configuration.

RockfordLhotka replied on Friday, August 24, 2007

I think you'll need to create your own variation on the remoting proxy. You can just copy-paste the proxy code from CSLA into your project, then alter the way remoting is configured to put the custom header information into the message.

Unfortunately I don't know how to put the custom header information in the message, sorry... I'd recommend looking at Ingo Rammer's remoting book to see if he discusses that topic.

ktweedy replied on Friday, August 24, 2007

Thanks, I have that book right in front of me.  Will let you know if I figure it out. 

ktweedy replied on Monday, September 24, 2007

In case anyone else needs to do this the way i solved it is adding a custom client sink to the .NET Remoting HTTP Channel so insert the needed headers into the HTTP request objects and a custom server sink to extract header information.

My RemotingProxy.cs constructor HTTP channel create looks  like this.

BinaryClientFormatterSinkProvider formatter = new BinaryClientFormatterSinkProvider();
SecurityClientChannelSinkProvider
clientChannelSinkProvider = new SecurityClientChannelSinkProvider();
formatter.Next = clientChannelSinkProvider;
HttpChannel channel = new HttpChannel(properties, formatter, null);

Copyright (c) Marimer LLC