WebException when accessing webservice via proxy

G

Greg

Hi all,

When I call web service via a proxy I get a Web exception saying this:

<HTML><HEAD><TITLE>Found</TITLE></HEAD><BODY><H1>Found</H1>
This document has moved to a new location:



http://MappedServer/VirtualFolder/SomeWebService.asmx



Please update your documents and hotlists accordingly.</BODY></HTML>


the code I'm using is this:

myWebService ws= new myWebService();
ws.Url = "http://MappedServer/VirtualFolder/SomeWebService.asmx";
ws.Proxy = new WebProxy("proxyServer", 8081);
ws.Method1();

In the proxyServer machine I have a URL mapping that translates
http://MappedServer to http://WebServiceServer .

If I do a similar test with Internet Explorer it works fine. For example if
I put the proxy settings into IE and ask for the WSDL (type into the address
bar http://MappedServer/VirtualFolder/SomeWebService.asmx?WSDL) it works
fine.

Any ideas please?

Thanks in advanced,
Greg.
 
J

Javier G. Lozano

I'm not sure if the proxy's request is capable of following the
redirect. What I'm guessing is that IE gets a redirect request and
handles it for you. Try connecting directly to the WEbServiceServer
and see if it works.

Why are you trying to redirect the request?
 
G

Greg

Hi Javier,
I'm not sure if the proxy's request is capable of following the
redirect. What I'm guessing is that IE gets a redirect request and
handles it for you. Try connecting directly to the WEbServiceServer
and see if it works.

If the seetup the proxy correctly it will work. But this is not the senario
I'm iterested in.
Why are you trying to redirect the request?

Our software should be able to handle this senario. We've got customers that
set up their proxies with mapped URLs.

Many thanks,
Greg.
 
G

Greg

Hi,

What the article describes breflly is the fact that we can trap the
exception and re-issue a new request to the new location.

This wouldn't work for 2 reasons:

1. Only the proxy server can access machines outside the firewall. So
re-issuing a new request to the machine outside the firewall wouldn't work.

2. The new location returned by HttpResponse.Headers["Location"] as
described in the article still points to the original location. So, there is
no way of getting the new location.

Many thanks,
Greg.
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top