Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Problem accessing WebService through Proxy Server

Reply
Thread Tools

Problem accessing WebService through Proxy Server

 
 
Dermot O'Loughlin
Guest
Posts: n/a
 
      12-01-2004
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.SoapHttpClientProtoc ol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream, Boolean
asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtoc ol.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.c s:line 191
at SendSMS.SendSMSService.SendSMS(String numbers, String message)
in c:\inetpub\wwwroot\sendsms\sendsmsservice.asmx.cs: line 87
 
Reply With Quote
 
 
 
 
Dan Rogers
Guest
Posts: n/a
 
      12-01-2004
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.webservic es
>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: groups-
>NNTP-Posting-Date: Wed, 1 Dec 2004 17:31:12 +0000 (UTC)
>Path:

cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!cpmsftn gxa06.phx.gbl!TK2MSFTNGP08
phx.gbl!news-out.cwix.com!newsfeed.cwix.com!prodigy.com!news.gl orb.com!post
news.google.com!not-for-mail
>Xref: cpmsftngxa10.phx.gbl

microsoft.public.dotnet.framework.aspnet.webservic es:26940
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
>
>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.SoapHttpClientProtoc ol.ReadResponse(SoapClient
Message
>message, WebResponse response, Stream responseStream, Boolean
>asyncCall)
> at System.Web.Services.Protocols.SoapHttpClientProtoc ol.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
>


 
Reply With Quote
 
 
 
 
dermot_o_loughlin@yahoo.com
Guest
Posts: n/a
 
      12-02-2004
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.webservic es
> >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: groups-
> >NNTP-Posting-Date: Wed, 1 Dec 2004 17:31:12 +0000 (UTC)
> >Path:

>

cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!cpmsftn gxa06.phx.gbl!TK2MSFTNGP08
>

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

> microsoft.public.dotnet.framework.aspnet.webservic es:26940
> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
> >
> >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.SoapHttpClientProtoc ol.ReadResponse(SoapClient
> Message
> >message, WebResponse response, Stream responseStream, Boolean
> >asyncCall)
> > at

System.Web.Services.Protocols.SoapHttpClientProtoc ol.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
> >


 
Reply With Quote
 
dermot_o_loughlin@yahoo.com
Guest
Posts: n/a
 
      12-02-2004
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.webservic es
> >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: groups-
> >NNTP-Posting-Date: Wed, 1 Dec 2004 17:31:12 +0000 (UTC)
> >Path:

>

cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!cpmsftn gxa06.phx.gbl!TK2MSFTNGP08
>

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

> microsoft.public.dotnet.framework.aspnet.webservic es:26940
> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
> >
> >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.SoapHttpClientProtoc ol.ReadResponse(SoapClient
> Message
> >message, WebResponse response, Stream responseStream, Boolean
> >asyncCall)
> > at

System.Web.Services.Protocols.SoapHttpClientProtoc ol.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
> >


 
Reply With Quote
 
Dan Rogers
Guest
Posts: n/a
 
      12-02-2004
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.webservic es
>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: <. com>
>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: groups-
>NNTP-Posting-Date: Thu, 2 Dec 2004 09:15:25 +0000 (UTC)
>User-Agent: G2/0.2
>Complaints-To: groups-
>Injection-Info: z14g2000cwz.googlegroups.com; posting-host=83.70.155.58;
> posting-account=vpdbngwAAACg0AqmYwjg7YXkEbGa-pJS
>Path:

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

microsoft.public.dotnet.framework.aspnet.webservic es:26986
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
>
>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.webservic es
>> >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: groups-
>> >NNTP-Posting-Date: Wed, 1 Dec 2004 17:31:12 +0000 (UTC)
>> >Path:

>>

>cpmsftngxa10.phx.gbl!TK2MSFTNGXA01.phx.gbl!cpmsft ngxa06.phx.gbl!TK2MSFTNGP0

8
>>

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

>> microsoft.public.dotnet.framework.aspnet.webservic es:26940
>> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
>> >
>> >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.SoapHttpClientProto col.ReadResponse(SoapClien

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

>System.Web.Services.Protocols.SoapHttpClientProto col.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
>> >

>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to call a webservice through a proxy server with java (axis)? contrex Java 5 07-23-2011 11:05 AM
Problem accessing through a proxy Bruno Vignola Java 6 08-22-2008 01:45 PM
How to Accessing a Web Service Through a Proxy Server? mizi ASP General 1 07-24-2006 06:32 AM
Help: Connecting to a password-protected webservice through a proxy server (ISA 2000) Hanz Gruuber ASP .Net Web Services 0 04-29-2005 04:58 AM
WebService Client not authenticating through Proxy Server JD ASP .Net Web Services 5 10-07-2004 09:58 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57