Using IE proxy server settings in a web service client

Discussion in 'ASP .Net Web Services' started by Kenneth Jonsson, Apr 7, 2010.

  1. I can not make proxy server settings in Internet Explorer work for my web
    service client. When the proxy is defined manually, all is well.

    But, when I import settings from Internet Explorer, the IsBypassed attribyte
    becomes true and the address returned from GetProxy(url) is the same as the
    Url I am entering in the call.
    I do not know how the proxy server is configured, perhaps someone have an
    advice for me or for the administrator of the proxy server?

    When connecting to the network, from my office, through VPN, all is also
    well in both cases. IsBypassed=false and GetProxy returns the address to the
    actual proxy server.
    And when I start IE and try the address of the web service server, I can
    connect to it!

    Reading about proxy servers, it seems it would work automatially, I have
    also tried to run the program without setting the proxy, with same
    dissapointing result.

    I have spent days trying to make IE settings work in my program, but with
    little success, and is wery greatful for any help in this matter.

    Regards,
    Kenneth Jonsson


    public void SetServerProxy(SoapHttpClientProtocol service)
    {
    if (...)
    {
    // Install user proxy settings
    WebProxy userProxy = new WebProxy(ProxyServer);
    NetworkCredential credential = new NetworkCredential(ProxyUser,
    ProxyPassword, ProxyDomain);
    userProxy.Credentials = credential;
    service.Proxy = userProxy;

    }
    else
    {
    // Install default IE proxy settings
    service.Proxy = WebRequest.GetSystemWebProxy();
    service.Proxy.Credentials = CredentialCache.DefaultNetworkCredentials;
    bool isBypassed = service.Proxy.IsBypassed(new Uri(service.Url)); <--
    becomes true
    Uri proxy = service.Proxy.GetProxy(new Uri(service.Url)); <-- is not
    the proxy server defined in Internet Explorer (instead it is the Url entered
    in the call)
    }
    }
     
    Kenneth Jonsson, Apr 7, 2010
    #1
    1. Advertisements

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. Matthijs
    Replies:
    1
    Views:
    1,004
    Mike Meyer
    Apr 14, 2005
  2. leeanne
    Replies:
    0
    Views:
    2,125
    leeanne
    Sep 24, 2008
  3. donet programmer
    Replies:
    3
    Views:
    2,083
    Gregory A. Beamer
    Nov 20, 2009
  4. Paul Fin

    XML Web service client without proxy instance?

    Paul Fin, Sep 10, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    256
    Paul Fin
    Sep 10, 2003
  5. Jorge Loureriro
    Replies:
    2
    Views:
    359
    Rolf Tollerud
    Feb 11, 2004
  6. Chris

    Invoking Web Service wothout client proxy

    Chris, Feb 19, 2004, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    312
    Michael Pearson
    Feb 19, 2004
  7. dave v

    XsdObjectGen classes in Web Service Client Proxy

    dave v, Feb 9, 2005, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    268
    Steven Cheng[MSFT]
    Feb 10, 2005
  8. Replies:
    0
    Views:
    384
Loading...