Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/01/2008, 13:04
Gelipon
 
Fecha de Ingreso: agosto-2006
Mensajes: 45
Antigüedad: 17 años, 8 meses
Puntos: 0
Error 407 con Proxy al consumir WebService

Que tal, pues tengo un problema al consumir un webservice dentro de mi aplicacion, resulta que lo puedo ver desde el navegador, también pude agregar el web reference dentro de mi aplicación y tengo acceso a los métodos dentro de el, pero al momento de ejecutar la aplicacion se dispara una excepción que dice lo siguiente:

"The request failed with HTTP status 407: Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy service is denied. )."

Dentro de las propiedades de LAN de Internet Explorer, tengo configurado que acceda a Internet a través de un Proxy el cual tiene un usuario y un password, pero para poder ver el WebService en el navegador no necesito de ese proxy y excluí en la configuracion de la LAN la direccion donde esta corriendo el webservice, esto lo hice poniendo *.dominio.com.mx en las opciones avanzadas, sin embargo no se si en mi aplicacion deba hacer algo parecido para tener acceso a los datos en tiempo de ejecucion. Mi código para asignar las credenciales al web service es el siguiente


public static void SetNetworkCredentials(System.Web.Services.Protocol s.SoapHttpClientProtocol SC)
{
string wsUser = System.Configuration.ConfigurationManager.AppSetti ngs["AccessPointUser"].ToString();
string wsPassword = System.Configuration.ConfigurationManager.AppSetti ngs["AccessPointPassword"].ToString();
string wsDomain = System.Configuration.ConfigurationManager.AppSetti ngs["AccessPointDomain"].ToString();

System.Net.NetworkCredential networkCredential = new System.Net.NetworkCredential(wsUser, wsPassword, wsDomain);

System.Net.CredentialCache credentialCache = new System.Net.CredentialCache();
credentialCache.Add(new Uri(SC.Url), "Negotiate", networkCredential);//NTLM
SC.UnsafeAuthenticatedConnectionSharing = true;
SC.ConnectionGroupName = "AccessPoint";
SC.Credentials = credentialCache;
}


Alguna Idea????