AdWords API Re: timeout exception
thanks for your both response, here are the details:
Im using C# on microsoft visual studiol.net 2005 edition.
the problem is that the service can't be "kept-alive" if Im behind
firewall/proxy
I have found a solution here:
http://weblogs.asp.net/jan/archive/2004/01/28/63771.aspx
which is to override the GetWebRequest function like this (setting
KeepAlive to false)
protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
System.Net.HttpWebRequest webRequest =
(System.Net.HttpWebRequest)base.GetWebRequest(uri);
webRequest.KeepAlive = false;
return webRequest;
}
in every webservice.
I did it and it works, but I dont like changing the webservice/system
code, Im sure there is a place where you can define the default
behavior to non-keepalive. I just dont know where.
anyway -
for other readers - you may Ialso need to change ProtocolVersion to
HTTP10 if it doesnt help.
Patrick Chanezon wrote:
> Hi Yaron,
> this looks like an exception coming from the network stack you are using.
> You need to send more details about the libraries/language you use if you
> want some help with this issue.
>
> P@
>
> On 12/25/05, yaron <yaron@ez-net.co.il> wrote:
> >
> >
> > I need to post web service requests in my software from time to time.
> > should I somehow close the connection after each request?
> >
> > Im behind a firewall and the first request behaves ok.
> > but if the 2nd request is being made after abit long pause I get
> > exception:
> >
> > "The underlying connection was closed: A connection that was expected
> > to be kept alive was closed by the server"
> >
> >
> > then the 3rd request again behaves ok.
> >
> >
> > for my software - I dont need to keep the connection alive, or any
> > timeout requirements,
> > I just dont want to get this exception.
> >
> > thanks
> >
> >
>
>
> --
> Patrick Chanezon, AdWords API evangelist
> http://blog.chanezon.com/
> http://www.google.com/apis/adwords/
0 Comments:
Yorum Gönder
<< Home