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. 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. Maras
    Replies:
    0
    Views:
    1,550
    Maras
    May 18, 2004
  2. Maras
    Replies:
    1
    Views:
    1,018
    Maras
    May 25, 2004
  3. leeanne
    Replies:
    0
    Views:
    1,881
    leeanne
    Sep 24, 2008
  4. donet programmer
    Replies:
    3
    Views:
    1,559
    Gregory A. Beamer
    Nov 20, 2009
  5. Clint

    WCF Proxy Server settings not working

    Clint, Sep 30, 2008, in forum: ASP .Net Web Services
    Replies:
    10
    Views:
    1,286
    Steven Cheng
    Oct 17, 2008
Loading...

Share This Page