Proxy server and webservice

Discussion in 'ASP .Net' started by Jan Rasmussen, Dec 8, 2003.

  1. I have installed a windowsservice at a customer, and this service should
    communicate with a webservice here by me. This works fine a lot of places,
    but now it has been installed by a customer who runs a proxy server, and all
    http-communication from the workstations runs on port 88 instead of the
    default port 80.
    Now the windowsservice starts with an error message: Can't connect to host

    How do I work around that problem ?

    TIA

    Jan
     
    Jan Rasmussen, Dec 8, 2003
    #1
    1. Advertising

  2. You can set a global proxy in a config file [1], or in code [2], or you can
    set a proxy server per webservice,
    via the Proxy property on the clien-side stub (generated from WSDL). [3]

    These examples show how to set the proxy without authentication:

    eg [1], in machine.config, add
    <configuration>
    <system.net>
    ...
    <defaultProxy>
    <proxy
    usesystemdefault = "false"
    proxyaddress=http://proxyserver:8089
    bypassonlocal="true" />
    </defaultProxy>
    ...
    </system.net>
    </configuration>

    eg [2]
    using System.Net; // contains GlobalProxySelection class
    ...
    Uri proxyURI = new Uri("http://proxyserver::8089");
    GlobalProxySelection.Select = new WebProxy(proxyURI);


    eg [3]
    p = MyWebService(); // stub generated from wsdl.exe, inherits from
    System.Web.Services.Protocols.SoapHttpClientProtocol
    p.Proxy = new System.Net.WebProxy("http://proxyserver:8089",false); //
    true == don't use proxy for local addresses

    In any of those cases you can also set up a proxy that requires
    authentication (username and password).

    references:
    [1]
    http://msdn.microsoft.com/library/en-us/cpgenref/html/gngrfDefaultProxyElement.asp
    [2]
    http://msdn.microsoft.com/library/en-us/cpguide/html/cpconaccessinginternetthroughproxy.asp
    [3]
    http://msdn.microsoft.com/library/e...otocolsSoapHttpClientProtocolMembersTopic.asp


    -D

    "Jan Rasmussen" <jan#nospam#@midasdata.no> wrote in message
    news:...
    > I have installed a windowsservice at a customer, and this service should
    > communicate with a webservice here by me. This works fine a lot of places,
    > but now it has been installed by a customer who runs a proxy server, and

    all
    > http-communication from the workstations runs on port 88 instead of the
    > default port 80.
    > Now the windowsservice starts with an error message: Can't connect to host
    >
    > How do I work around that problem ?
    >
    > TIA
    >
    > Jan
    >
    >
     
    Dino Chiesa [Microsoft], Dec 8, 2003
    #2
    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. contrex
    Replies:
    5
    Views:
    62,659
    thebigj816
    Jul 23, 2011
  2. Bjoern Bredohl
    Replies:
    0
    Views:
    680
    Bjoern Bredohl
    Dec 10, 2005
  3. JD
    Replies:
    5
    Views:
    281
    Lalitha
    Oct 7, 2004
  4. Q. John Chen

    WebService and Proxy Server

    Q. John Chen, Oct 28, 2004, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    142
    Q. John Chen
    Oct 28, 2004
  5. Dermot O'Loughlin

    Problem accessing WebService through Proxy Server

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

Share This Page