How to set timeout using Java client library

391 views
Skip to first unread message

Kevin

unread,
Dec 2, 2011, 2:35:28 PM12/2/11
to adwor...@googlegroups.com
Hi,

Is there a way to set the timeout for service calls using AdWords Java client library?  One of our service calls got stucks for hours doing initial SSL Handshake:

at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:293)
at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:331)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:782)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1089)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1116)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1100)
at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:186)
at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
at com.google.api.adwords.lib.AdWordsHttpSender.invoke(AdWordsHttpSender.java:60)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.google.api.adwords.v201101.cm.CampaignServiceSoapBindingStub.mutate(CampaignServiceSoapBindingStub.java:1146)

Thanks,
Kevin

Kevin Winter

unread,
Dec 5, 2011, 12:41:58 PM12/5/11
to adwor...@googlegroups.com
Hi Kevin,
  Unfortunately, there is currently no built-in way to do this with the library.  It would be possible to patch the library to make this happen - for example, AdWordsHttpSender could be modified to set a property into the messageContext prior to sending, or the AdWordsServiceFactory could be modified to use the CommonsHttpSender as described here: http://wiki.apache.org/ws/FrontPage/Axis/AxisCommonsHTTP

We're added this to our TODO list to investigate adding for the rewritten java client library.

Note: issues like the ones you describe above are usually problems with proxy servers misbehaving.  Are you using a proxy server?

- Kevin Winter
AdWords API Team
Reply all
Reply to author
Forward
0 new messages