I'm using Visual Basic.Net in Visual Studio 2005. I'm using the code
generated to call the web services, and have made the following
changes (by inheriting the class and overriding the GetWebRequest()
method):
webRequest.KeepAlive = False
webRequest.Timeout = 10000000
webRequest.CachePolicy = New
Net.Cache.HttpRequestCachePolicy(Net.Cache.HttpRequestCacheLevel.NoCacheNoStore)
webRequest.ProtocolVersion = Net.HttpVersion.Version10
However these don't seem to make any difference. I've also written
some code to retry 3 times when it fails but this just fails at the
same point each time.
One thing that is slightly worrying is the system seems to work fine
when run from my laptop but when I run it from the server it can fail
after calling the updateCriteria method only once. I have a campaign
with 60 adgroups and 350 keywords to send to google. These work first
time everytime on my laptop, but fail everytime (at different points)
on the server. I'm running Windows XP Pro SP2 on my laptop, the
server is Windows Server 2003 SP2.
Is there any other properties I need to set? I'm pretty sure it's
a .Net issue rather than a Google Adwords issue but am posting here in
the hope other people have had the same problem. Could it be a
problem with the configuration on the server?
Pay attention that the wsdl generated classes by .net inherit from
System.Web.Services.Protocols.SoapHttpClientProtocol.
Make sure to call the base.Dispose() method after using it to release
resources. Or wrap it in a using{} /c#/ block (the equivalent in
VB.NET)
Hope this helps,
Albert
Rgds
Jesper