Remoting error over Http channel (401) Unauthorized

Hi ... I'm trying to implement Remoting with an Http Channel, to do this, I add a Remoting.config file to a WebServer Application and on the App_Start Event I run the following line :

Dim strRemConfig As String
strRemConfig = HttpContext.Current.Server.MapPath("./Remoting.config")
RemotingConfiguration.Configure(strRemConfig)

And my Remote Object is started !!

I have a test client, to check the functionallity, and It only works when the Virtual Directory is configured with an Anonymous Access in the Directory Security Options. (uses the IUSR_XXX user). but when I change to the "Integrated Windows Authentication" mode I receive the following error:


************** Exception Text **************
System.Net.WebException: The underlying connection was closed: The request was canceled.

Server stack trace:
at System.Net.HttpWebRequest.CheckFinalStatus()


I also receive a "401 Unauthorized error" sometimes.

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Net.WebException: The remote server returned an error: (401) Unauthorized.

Server stack trace:
at System.Runtime.Remoting.Channels.Http.HttpClientTransportSink.ProcessResponseException(WebException webException, HttpWebResponse& response)
at System.Runtime.Remoting.Channels.Http.HttpClientTransportSink.ProcessMessage(IMessage msg, ITransportHeaders requestHeaders, Stream requestStream, ITransportHeaders& responseHeaders, Stream& responseStream)
at System.Runtime.Remoting.Channels.SoapClientFormatterSink.SyncProcessMessage(IMessage msg)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Sample.ICommonObj.GetDate()


Do you have any suggestions to do this ? I want the Integrated Windows Authentication, to propagate the local logued Windows user and have integrated security in the BackEnd.

Thanks from Spain
El Bruno

PD: Sorry 4 my poor English.

[2289 byte] By [ElBruno] at [2008-1-21]
# 1
I finally make this work ...

I have to use the useDefaultCredentials=true on a config file, just like Cooler told me.

I put the following code in a Remoting.config file

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

<system.runtime.remoting>

<application>

<channels>

<channel ref='http' useDefaultCredentials='true'>

<clientProviders>

<formatter ref='binary' />

</clientProviders>

</channel>

</channels>

</application>

</system.runtime.remoting>

</configuration>

After this, I configure Remoting to use the config file and load the settings inside the file.


Dim file As String = "Remoting.config"

RemotingConfiguration.Configure(file)


And now it works !!

Thanks to everybody

ElBruno at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 2
I tried your "useDefaultCredentials" and it still does not work... Can you help me by chance? I am using .NET 2.0 and running it local on my machine...
I can not seem to get the remoting piece to "Activate" the object...

Thanks,
ward0093

ward0093 at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...
# 3
Yes I'll help you ...
Post some sample code and We'll check it !!!

Bye from Spain

El Bruno

ElBruno at 2007-8-21 > top of Msdn Tech,.NET Development,.NET Remoting and Runtime Serialization...

.NET Development

Site Classified