WebException when accessing webservice via proxy

Discussion in 'ASP .Net Web Services' started by Greg, Mar 15, 2006.

  1. Greg

    Greg Guest

    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.
     
    Greg, Mar 15, 2006
    #1
    1. Advertising

  2. 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?
     
    Javier G. Lozano, Mar 16, 2006
    #2
    1. Advertising

  3. Greg

    Greg Guest

    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.
     
    Greg, Mar 16, 2006
    #3
  4. Greg

    Guest

    , Mar 17, 2006
    #4
  5. Greg

    Greg Guest

    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.
     
    Greg, Mar 17, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. atip

    System.Net.WebException when calling a webservice

    atip, Jun 10, 2004, in forum: ASP .Net Web Services
    Replies:
    15
    Views:
    451
    Yan-Hong Huang[MSFT]
    Jun 24, 2004
  2. Dermot O'Loughlin

    Problem accessing WebService through Proxy Server

    Dermot O'Loughlin, Dec 1, 2004, in forum: ASP .Net Web Services
    Replies:
    4
    Views:
    561
    Dan Rogers
    Dec 2, 2004
  3. AlBruAn

    Accessing a .NET Webservice via JavaScript

    AlBruAn, Aug 14, 2007, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    161
    Laurent Bugnion, MVP
    Aug 17, 2007
  4. Ryan
    Replies:
    0
    Views:
    553
  5. Achim Domma
    Replies:
    2
    Views:
    135
    Achim Domma
    May 24, 2007
Loading...

Share This Page