D
dan kisting
Hello,
I am writing a c# application which connects to web services through a
Proxy Server. I am running a local Proxy Host to simulate what the
user is seeing, and his problem is he is getting a 407 error, Proxy
Authentication Required. I am applying the credentials and I realize I
am probably just missing something. Here is my code, do I need any
modifications on the Web Service?
WebService service = new WebService();
WebProxy proxy = new WebProxy(this.txtProxyHost.Text,
int.Parse(this.txtPort.Text));
proxy.BypassProxyOnLocal = true;
NetworkCredential cred = new NetworkCredential(this.txtUserName.Text,
this.txtPassword.Text,
this.txtDomain.Text);
proxy.Credentials = cred;
service .Timeout = 20000;
service .Proxy = proxy;
WebRequest req = WebRequest.Create(service .Url);
req.Proxy = proxy;
******************
Me again, the last two lines I am unsure about, but do I need to do
anything special when accessing the Web Method?
I saw something about Proxy-Authentication which may be an issue, but
again, not sure if applicable here.
Thank you in advance.!
I am writing a c# application which connects to web services through a
Proxy Server. I am running a local Proxy Host to simulate what the
user is seeing, and his problem is he is getting a 407 error, Proxy
Authentication Required. I am applying the credentials and I realize I
am probably just missing something. Here is my code, do I need any
modifications on the Web Service?
WebService service = new WebService();
WebProxy proxy = new WebProxy(this.txtProxyHost.Text,
int.Parse(this.txtPort.Text));
proxy.BypassProxyOnLocal = true;
NetworkCredential cred = new NetworkCredential(this.txtUserName.Text,
this.txtPassword.Text,
this.txtDomain.Text);
proxy.Credentials = cred;
service .Timeout = 20000;
service .Proxy = proxy;
WebRequest req = WebRequest.Create(service .Url);
req.Proxy = proxy;
******************
Me again, the last two lines I am unsure about, but do I need to do
anything special when accessing the Web Method?
I saw something about Proxy-Authentication which may be an issue, but
again, not sure if applicable here.
Thank you in advance.!