Hola a todos estoy probando remoting con IIS, al momento de invocar a un
método de un objeto remoto me sale el siguiente error:
The remote server returned an error: (401) Unauthorized.
Exception Details: System.Net.WebException: The remote server returned an
error: (401) Unauthorized.
Este es mi remoting.conf
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<client url="
http://xxxx:80/RemComponent">
<wellknown type="SampleRemotedClassLib.Class1, SampleRemotedClassLib"
url="
http://xxxx:80/RemComponent/Class1.rem" />
</client>
<channels>
<channel ref="http" useDefaultCredentials="false">
<clientProviders>
<formatter ref="binary" />
</clientProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>
Y esto es el codigo donde supuestamente accedo al objeto remoto mediante el
proxy
SampleRemotedClassLib.Class1 sam = new SampleRemotedClassLib.Class1();
IDictionary cha = ChannelServices.GetChannelSinkProperties(sam);
NetworkCredential credd = new
NetworkCredential("usuario","password","dominio");
ObjRef objectReference = RemotingServices.Marshal(sam);
Uri objectUri = new Uri(objectReference.URI);
CredentialCache creddCache = new CredentialCache();
creddCache.Add(objectUri, "Negotiate", credd);
cha["credd"] = creddCache;
cha["preauthenticate"] = true;
Yo utilizo el NTLM y tengo desabilitado el acceso anónimo en el IIS.
He cambiado en el código de negotiate a NTLM y luego a Kerberos, pero nada .
También hice un código a parte para acceder con networkcredential al
recurso .rem, pero sólo funcionó con Negotiate.
¿Qué puede estar sucediendo?
Espero que me ayuden gracias.
Leer las respuestas