error con remoting

31/08/2005 - 18:30 por andy O | Informe spam
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.

Preguntas similare

Leer las respuestas

#1 andy O
31/08/2005 - 19:20 | Informe spam
Parece que algunos códigos de internet tienen fallas.

Encontré el error:

cha["credd"] = creddCache;
Debe ser credentials en lugar de creed.


Pongo la solución si es que alguien se quedó entrampado allí.


"andy O" wrote:

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.


email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida