Problem accessing WebService through Proxy Server

Discussion in 'ASP .Net Web Services' started by Dermot O'Loughlin, Dec 1, 2004.

  1. I get the following error when trying to access a Webservice through
    my proxy server. I know that the authentication credentials are
    correct because if i use an incorrect username I get a message saying
    that i can't be authenticated. I can't understand why I get a timeout.

    Any help much appreciated.


    System.Net.WebException: The request failed with HTTP status 504:
    Proxy Timeout ( Connection timed out. For more information about this
    event, see ISA Server Help. ).
    at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
    message, WebResponse response, Stream responseStream, Boolean
    asyncCall)
    at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
    methodName, Object[] parameters)
    at b2m.B2M_MessageSenderService.login(String account, String
    login4, String password) in c:\documents and settings\doloughlin\my
    documents\visual studio
    projects\sms\b2mlibrary\b2m_messagesenderservice.cs:line 191
    at SendSMS.SendSMSService.SendSMS(String numbers, String message)
    in c:\inetpub\wwwroot\sendsms\sendsmsservice.asmx.cs:line 87
    Dermot O'Loughlin, Dec 1, 2004
    #1
    1. Advertising

  2. Dermot O'Loughlin

    Dan Rogers Guest

    Hi Dermot,

    Without seeing the code you are using to set up the web service proxy's
    HTTP connection's proxy server setting, it's hard to say what's what. In
    general, however code such as the following will be something to consider
    if you aren't already there...

    myproxy.v1 serviceProxy = new myproxy.v1();
    serviceProxy.Proxy = new System.Net.WebProxy("proxyURL", true);

    There are several overloads to the WebProxy constuctor.

    The first line represents instantiation of my web service proxy that I
    generated by adding a web reference to my project.
    The second line represents setting the HTTP proxy settings for the proxy
    server. I used a two argument flavor that would make the call with the
    current user credentials, and let me specify the URI for the proxy server,
    and to bypass the proxy server for resolving local intranet requests.
    There are also overloads that let you explicitely pass a credential object
    that you would have to create yourself at runtime).

    I hope this helps

    Dan Rogers
    Microsoft Corporation


    --------------------
    >From: (Dermot O'Loughlin)
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    >Subject: Problem accessing WebService through Proxy Server
    >Date: 1 Dec 2004 09:31:11 -0800
    >Organization: http://groups.google.com
    >Lines: 22
    >Message-ID: <>
    >NNTP-Posting-Host: 83.70.155.58
    >Content-Type: text/plain; charset=ISO-8859-1
    >Content-Transfer-Encoding: 8bit
    >X-Trace: posting.google.com 1101922272 24798 127.0.0.1 (1 Dec 2004

    17:31:12 GMT)
    >X-Complaints-To:
    >NNTP-Posting-Date: Wed, 1 Dec 2004 17:31:12 +0000 (UTC)
    >Path:

    cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08
    phx.gbl!news-out.cwix.com!newsfeed.cwix.com!prodigy.com!news.glorb.com!post
    news.google.com!not-for-mail
    >Xref: cpmsftngxa10.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webservices:26940
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    >
    >I get the following error when trying to access a Webservice through
    >my proxy server. I know that the authentication credentials are
    >correct because if i use an incorrect username I get a message saying
    >that i can't be authenticated. I can't understand why I get a timeout.
    >
    >Any help much appreciated.
    >
    >
    >System.Net.WebException: The request failed with HTTP status 504:
    >Proxy Timeout ( Connection timed out. For more information about this
    >event, see ISA Server Help. ).
    > at

    System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClient
    Message
    >message, WebResponse response, Stream responseStream, Boolean
    >asyncCall)
    > at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
    >methodName, Object[] parameters)
    > at b2m.B2M_MessageSenderService.login(String account, String
    >login4, String password) in c:\documents and settings\doloughlin\my
    >documents\visual studio
    >projects\sms\b2mlibrary\b2m_messagesenderservice.cs:line 191
    > at SendSMS.SendSMSService.SendSMS(String numbers, String message)
    >in c:\inetpub\wwwroot\sendsms\sendsmsservice.asmx.cs:line 87
    >
    Dan Rogers, Dec 1, 2004
    #2
    1. Advertising

  3. Dermot O'Loughlin

    Guest

    Dan,

    here is the code I use:

    System.Net.ICredentials credential = new System.Net.NetworkCredential(
    ConfigurationSettings.AppSettings[Global.ProxyUsername],
    ConfigurationSettings.AppSettings[Global.ProxyPassword],
    ConfigurationSettings.AppSettings[Global.ProxyDomain]);

    WebProxy myProxy=new
    WebProxy(ConfigurationSettings.AppSettings[Global.ProxyServer],true,null,credential);


    //assign proxy to webservice
    b2m.Proxy = myProxy;

    //call to webservice method
    string auth =
    b2m.login(ConfigurationSettings.AppSettings[Global.SMSAccount],
    ConfigurationSettings.AppSettings

    All proxy info is stored in a config file and is correct. For some
    reason the call to the login method of the webservice fails giving a
    proxy timeout error.

    Any ideas?

    Thanks,
    Dermot.

    Dan Rogers wrote:
    > Hi Dermot,
    >
    > Without seeing the code you are using to set up the web service

    proxy's
    > HTTP connection's proxy server setting, it's hard to say what's what.

    In
    > general, however code such as the following will be something to

    consider
    > if you aren't already there...
    >
    > myproxy.v1 serviceProxy = new myproxy.v1();
    > serviceProxy.Proxy = new System.Net.WebProxy("proxyURL", true);
    >
    > There are several overloads to the WebProxy constuctor.
    >
    > The first line represents instantiation of my web service proxy that

    I
    > generated by adding a web reference to my project.
    > The second line represents setting the HTTP proxy settings for the

    proxy
    > server. I used a two argument flavor that would make the call with

    the
    > current user credentials, and let me specify the URI for the proxy

    server,
    > and to bypass the proxy server for resolving local intranet requests.


    > There are also overloads that let you explicitely pass a credential

    object
    > that you would have to create yourself at runtime).
    >
    > I hope this helps
    >
    > Dan Rogers
    > Microsoft Corporation
    >
    >
    > --------------------
    > >From: (Dermot O'Loughlin)
    > >Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    > >Subject: Problem accessing WebService through Proxy Server
    > >Date: 1 Dec 2004 09:31:11 -0800
    > >Organization: http://groups.google.com
    > >Lines: 22
    > >Message-ID: <>
    > >NNTP-Posting-Host: 83.70.155.58
    > >Content-Type: text/plain; charset=ISO-8859-1
    > >Content-Transfer-Encoding: 8bit
    > >X-Trace: posting.google.com 1101922272 24798 127.0.0.1 (1 Dec 2004

    > 17:31:12 GMT)
    > >X-Complaints-To:
    > >NNTP-Posting-Date: Wed, 1 Dec 2004 17:31:12 +0000 (UTC)
    > >Path:

    >

    cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08
    >

    phx.gbl!news-out.cwix.com!newsfeed.cwix.com!prodigy.com!news.glorb.com!post
    > news.google.com!not-for-mail
    > >Xref: cpmsftngxa10.phx.gbl

    > microsoft.public.dotnet.framework.aspnet.webservices:26940
    > >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    > >
    > >I get the following error when trying to access a Webservice through
    > >my proxy server. I know that the authentication credentials are
    > >correct because if i use an incorrect username I get a message

    saying
    > >that i can't be authenticated. I can't understand why I get a

    timeout.
    > >
    > >Any help much appreciated.
    > >
    > >
    > >System.Net.WebException: The request failed with HTTP status 504:
    > >Proxy Timeout ( Connection timed out. For more information about

    this
    > >event, see ISA Server Help. ).
    > > at

    >

    System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClient
    > Message
    > >message, WebResponse response, Stream responseStream, Boolean
    > >asyncCall)
    > > at

    System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
    > >methodName, Object[] parameters)
    > > at b2m.B2M_MessageSenderService.login(String account, String
    > >login4, String password) in c:\documents and settings\doloughlin\my
    > >documents\visual studio
    > >projects\sms\b2mlibrary\b2m_messagesenderservice.cs:line 191
    > > at SendSMS.SendSMSService.SendSMS(String numbers, String message)
    > >in c:\inetpub\wwwroot\sendsms\sendsmsservice.asmx.cs:line 87
    > >
    , Dec 2, 2004
    #3
  4. Dermot O'Loughlin

    Guest

    Dan,

    here is the code I use:

    WebProxy myProxy;
    {
    System.Net.ICredentials credential = new System.Net.NetworkCredential(
    ConfigurationSettings.AppSettings[Global.ProxyUsername],
    ConfigurationSettings.AppSettings[Global.ProxyPassword],
    ConfigurationSettings.AppSettings[Global.ProxyDomain]);

    myProxy=new
    WebProxy(ConfigurationSettings.AppSettings[Global.ProxyServer],true,null,credential);


    b2m.Proxy = myProxy;

    // call to webservice
    string auth =
    b2m.login(ConfigurationSettings.AppSettings[Global.SMSAccount],
    ConfigurationSettings.AppSettings

    All proxy info is stored in a config file and is correct. For some
    reason the call to the login method of the webservice fails giving a
    proxy timeout error.

    Any ideas?

    Thanks,
    Dermot.

    Dan Rogers wrote:
    > Hi Dermot,
    >
    > Without seeing the code you are using to set up the web service

    proxy's
    > HTTP connection's proxy server setting, it's hard to say what's what.

    In
    > general, however code such as the following will be something to

    consider
    > if you aren't already there...
    >
    > myproxy.v1 serviceProxy = new myproxy.v1();
    > serviceProxy.Proxy = new System.Net.WebProxy("proxyURL", true);
    >
    > There are several overloads to the WebProxy constuctor.
    >
    > The first line represents instantiation of my web service proxy that

    I
    > generated by adding a web reference to my project.
    > The second line represents setting the HTTP proxy settings for the

    proxy
    > server. I used a two argument flavor that would make the call with

    the
    > current user credentials, and let me specify the URI for the proxy

    server,
    > and to bypass the proxy server for resolving local intranet requests.


    > There are also overloads that let you explicitely pass a credential

    object
    > that you would have to create yourself at runtime).
    >
    > I hope this helps
    >
    > Dan Rogers
    > Microsoft Corporation
    >
    >
    > --------------------
    > >From: (Dermot O'Loughlin)
    > >Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    > >Subject: Problem accessing WebService through Proxy Server
    > >Date: 1 Dec 2004 09:31:11 -0800
    > >Organization: http://groups.google.com
    > >Lines: 22
    > >Message-ID: <>
    > >NNTP-Posting-Host: 83.70.155.58
    > >Content-Type: text/plain; charset=ISO-8859-1
    > >Content-Transfer-Encoding: 8bit
    > >X-Trace: posting.google.com 1101922272 24798 127.0.0.1 (1 Dec 2004

    > 17:31:12 GMT)
    > >X-Complaints-To:
    > >NNTP-Posting-Date: Wed, 1 Dec 2004 17:31:12 +0000 (UTC)
    > >Path:

    >

    cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08
    >

    phx.gbl!news-out.cwix.com!newsfeed.cwix.com!prodigy.com!news.glorb.com!post
    > news.google.com!not-for-mail
    > >Xref: cpmsftngxa10.phx.gbl

    > microsoft.public.dotnet.framework.aspnet.webservices:26940
    > >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    > >
    > >I get the following error when trying to access a Webservice through
    > >my proxy server. I know that the authentication credentials are
    > >correct because if i use an incorrect username I get a message

    saying
    > >that i can't be authenticated. I can't understand why I get a

    timeout.
    > >
    > >Any help much appreciated.
    > >
    > >
    > >System.Net.WebException: The request failed with HTTP status 504:
    > >Proxy Timeout ( Connection timed out. For more information about

    this
    > >event, see ISA Server Help. ).
    > > at

    >

    System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClient
    > Message
    > >message, WebResponse response, Stream responseStream, Boolean
    > >asyncCall)
    > > at

    System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
    > >methodName, Object[] parameters)
    > > at b2m.B2M_MessageSenderService.login(String account, String
    > >login4, String password) in c:\documents and settings\doloughlin\my
    > >documents\visual studio
    > >projects\sms\b2mlibrary\b2m_messagesenderservice.cs:line 191
    > > at SendSMS.SendSMSService.SendSMS(String numbers, String message)
    > >in c:\inetpub\wwwroot\sendsms\sendsmsservice.asmx.cs:line 87
    > >
    , Dec 2, 2004
    #4
  5. Dermot O'Loughlin

    Dan Rogers Guest

    Hi Dermott,

    You might want to trace the calls and see what specifically is happening on
    the timeout. Is it possible that the name of the proxy server isn't
    resolving correctly?

    Just some thoughts

    Dan
    --------------------
    >From:
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    >Subject: Re: Problem accessing WebService through Proxy Server
    >Date: 2 Dec 2004 01:15:21 -0800
    >Organization: http://groups.google.com
    >Lines: 123
    >Message-ID: <>
    >References: <>
    > <SpfQ#0#>
    >NNTP-Posting-Host: 83.70.155.58
    >Mime-Version: 1.0
    >Content-Type: text/plain; charset="iso-8859-1"
    >X-Trace: posting.google.com 1101978925 21470 127.0.0.1 (2 Dec 2004

    09:15:25 GMT)
    >X-Complaints-To:
    >NNTP-Posting-Date: Thu, 2 Dec 2004 09:15:25 +0000 (UTC)
    >User-Agent: G2/0.2
    >Complaints-To:
    >Injection-Info: z14g2000cwz.googlegroups.com; posting-host=83.70.155.58;
    > posting-account=vpdbngwAAACg0AqmYwjg7YXkEbGa-pJS
    >Path:

    cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fas
    twebnet.it!tiscali!newsfeed1.ip.tiscali.net!proxad.net!216.239.36.134.MISMAT
    CH!postnews.google.com!z14g2000cwz.googlegroups.com!not-for-mail
    >Xref: cpmsftngxa10.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webservices:26986
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    >
    >Dan,
    >
    >here is the code I use:
    >
    >System.Net.ICredentials credential = new System.Net.NetworkCredential(
    >ConfigurationSettings.AppSettings[Global.ProxyUsername],
    >ConfigurationSettings.AppSettings[Global.ProxyPassword],
    >ConfigurationSettings.AppSettings[Global.ProxyDomain]);
    >
    >WebProxy myProxy=new
    >WebProxy(ConfigurationSettings.AppSettings[Global.ProxyServer],true,null,cr

    edential);
    >
    >
    >//assign proxy to webservice
    >b2m.Proxy = myProxy;
    >
    >//call to webservice method
    >string auth =
    >b2m.login(ConfigurationSettings.AppSettings[Global.SMSAccount],
    >ConfigurationSettings.AppSettings
    >
    >All proxy info is stored in a config file and is correct. For some
    >reason the call to the login method of the webservice fails giving a
    >proxy timeout error.
    >
    >Any ideas?
    >
    >Thanks,
    >Dermot.
    >
    >Dan Rogers wrote:
    >> Hi Dermot,
    >>
    >> Without seeing the code you are using to set up the web service

    >proxy's
    >> HTTP connection's proxy server setting, it's hard to say what's what.

    >In
    >> general, however code such as the following will be something to

    >consider
    >> if you aren't already there...
    >>
    >> myproxy.v1 serviceProxy = new myproxy.v1();
    >> serviceProxy.Proxy = new System.Net.WebProxy("proxyURL", true);
    >>
    >> There are several overloads to the WebProxy constuctor.
    >>
    >> The first line represents instantiation of my web service proxy that

    >I
    >> generated by adding a web reference to my project.
    >> The second line represents setting the HTTP proxy settings for the

    >proxy
    >> server. I used a two argument flavor that would make the call with

    >the
    >> current user credentials, and let me specify the URI for the proxy

    >server,
    >> and to bypass the proxy server for resolving local intranet requests.

    >
    >> There are also overloads that let you explicitely pass a credential

    >object
    >> that you would have to create yourself at runtime).
    >>
    >> I hope this helps
    >>
    >> Dan Rogers
    >> Microsoft Corporation
    >>
    >>
    >> --------------------
    >> >From: (Dermot O'Loughlin)
    >> >Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    >> >Subject: Problem accessing WebService through Proxy Server
    >> >Date: 1 Dec 2004 09:31:11 -0800
    >> >Organization: http://groups.google.com
    >> >Lines: 22
    >> >Message-ID: <>
    >> >NNTP-Posting-Host: 83.70.155.58
    >> >Content-Type: text/plain; charset=ISO-8859-1
    >> >Content-Transfer-Encoding: 8bit
    >> >X-Trace: posting.google.com 1101922272 24798 127.0.0.1 (1 Dec 2004

    >> 17:31:12 GMT)
    >> >X-Complaints-To:
    >> >NNTP-Posting-Date: Wed, 1 Dec 2004 17:31:12 +0000 (UTC)
    >> >Path:

    >>

    >cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP0

    8
    >>

    >phx.gbl!news-out.cwix.com!newsfeed.cwix.com!prodigy.com!news.glorb.com!post
    >> news.google.com!not-for-mail
    >> >Xref: cpmsftngxa10.phx.gbl

    >> microsoft.public.dotnet.framework.aspnet.webservices:26940
    >> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    >> >
    >> >I get the following error when trying to access a Webservice through
    >> >my proxy server. I know that the authentication credentials are
    >> >correct because if i use an incorrect username I get a message

    >saying
    >> >that i can't be authenticated. I can't understand why I get a

    >timeout.
    >> >
    >> >Any help much appreciated.
    >> >
    >> >
    >> >System.Net.WebException: The request failed with HTTP status 504:
    >> >Proxy Timeout ( Connection timed out. For more information about

    >this
    >> >event, see ISA Server Help. ).
    >> > at

    >>

    >System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClien

    t
    >> Message
    >> >message, WebResponse response, Stream responseStream, Boolean
    >> >asyncCall)
    >> > at

    >System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
    >> >methodName, Object[] parameters)
    >> > at b2m.B2M_MessageSenderService.login(String account, String
    >> >login4, String password) in c:\documents and settings\doloughlin\my
    >> >documents\visual studio
    >> >projects\sms\b2mlibrary\b2m_messagesenderservice.cs:line 191
    >> > at SendSMS.SendSMSService.SendSMS(String numbers, String message)
    >> >in c:\inetpub\wwwroot\sendsms\sendsmsservice.asmx.cs:line 87
    >> >

    >
    >
    Dan Rogers, Dec 2, 2004
    #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. contrex
    Replies:
    5
    Views:
    62,105
    thebigj816
    Jul 23, 2011
  2. Bruno Vignola

    Problem accessing through a proxy

    Bruno Vignola, Aug 21, 2008, in forum: Java
    Replies:
    6
    Views:
    2,046
    Bruno Vignola
    Aug 22, 2008
  3. JD
    Replies:
    5
    Views:
    262
    Lalitha
    Oct 7, 2004
  4. Hanz Gruuber
    Replies:
    0
    Views:
    217
    Hanz Gruuber
    Apr 29, 2005
  5. mizi
    Replies:
    1
    Views:
    192
    Adrienne Boswell
    Jul 24, 2006
Loading...

Share This Page