Proxy Connection Web Services

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.!
 
D

dan kisting

I am not sure what Proxy server is used, it is on the client end. I am
not sure if it is an ISA server or what, but I will indeed try that.
There isn't anything specifc I would need on the Web Services end,
correct? I wouldn't think so...

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top