Re: Google App Engine SOAP call SocketTimeoutException

658 views
Skip to first unread message

Deepak Singh

unread,
Jun 1, 2012, 5:32:20 AM6/1/12
to Aljaz Delakorda, google-a...@googlegroups.com
Hi Aljaz,
 
I am still facing the same problem and app is running with problem.
 
Let us do something out of the box so that google puts an attention over the issue.
 
Thanks
Deepak

On Fri, Jun 1, 2012 at 2:35 PM, Aljaz Delakorda <dela...@gmail.com> wrote:
Hi Deepak,

Sorry to contact you in this way, but the Issue where you were discussing has been marked as obsolete.

I am having exact same Problem as you described here:
http://code.google.com/p/googleappengine/issues/detail?id=5927#c5

I am calling a soap service (via jax-ws) which uses UrlFetch internally. I become very often a SocketTimeotException while fetching the response... Did you find a way how to increase this Timeout? How did you solve the problem? I cannot find any solutions on the web...

I hope you can take a second to help me out.

Thank you for your time,
Best regards,
Aljaz Delakorda



--
Deepak Singh

Michel Jonker

unread,
Jun 21, 2012, 5:49:28 AM6/21/12
to google-a...@googlegroups.com, Aljaz Delakorda
Yes I have the same issue, I cannot find a way to increase the connect timeout through JAX-WS that is allowed by Google...

Emanuele Ziglioli

unread,
Jul 24, 2012, 9:13:40 PM7/24/12
to google-a...@googlegroups.com
It times out for me at times on the local server. Haven't found a way to increase the socket timeout. Have tried:
    System.setProperty("sun.net.client.defaultConnectTimeout", "10000");
    System.setProperty("sun.net.client.defaultReadTimeout", "10000");

It makes no difference. Then have tried:
       ((BindingProvider) port).getRequestContext().put(BindingProviderProperties.REQUEST_TIMEOUT, 30);
 
but it says "BindingProviderProperties is not supported by Google App Engine's Java runtime environment".
But at least when testing locally, it works most of the time.

Instead, on GAE servers, it fails. Have tried catching any exception but can't even do that.
The call that fails is:

new javax.xml.ws.Service(java.net.URL wsdlDocumentLocation, QName serviceName) 

Thiago Catoto

unread,
Jul 25, 2012, 9:36:00 AM7/25/12
to google-a...@googlegroups.com
Hi,

I'm pretty sure Appengine has the limit of 10s for UrlFetch (https://developers.google.com/appengine/docs/java/urlfetch/overview).

You may need to change the request to Task Queue if you have the need of longer requests, but it would get more complicated to handling the response to the SOAP "caller".

Hope it helps.

Best regards,
Thiago Catoto.


--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/DbLPCLSYVGoJ.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

Takashi Matsuo

unread,
Jul 25, 2012, 10:01:47 AM7/25/12
to google-a...@googlegroups.com

For clarification, it used to be 10 secs, but now the maximum deadline of the urlfetch is 60 seconds for online requests, 600 seconds for offline requests(taskqueue and cron).

-- Takashi
--
Takashi Matsuo

Thiago Catoto

unread,
Jul 25, 2012, 10:20:10 AM7/25/12
to google-a...@googlegroups.com
Thanks Takashi!

And sorry about the wrong info Emanuele...

Deepak Singh

unread,
Jul 25, 2012, 12:12:59 PM7/25/12
to google-a...@googlegroups.com
Hi Takashi,

How can we increase the deadline in case of SOAP client ?

Thanks
Deepak
Deepak Singh

Emanuele Ziglioli

unread,
Jul 25, 2012, 5:14:38 PM7/25/12
to google-a...@googlegroups.com
Yes! +1

is there a way to do it?
I'm also experiencing a different problem on the production server:

Deepak, 
it sounds you found a workaround for issue 4910, it that's the case, could you share your solution? thanks

Deepak

To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to google-appengine+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to google-appengine+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.



--
Takashi Matsuo

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to google-appengine+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to google-appengine+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.



--
Deepak Singh

Emanuele Ziglioli

unread,
Jul 26, 2012, 1:26:55 AM7/26/12
to google-a...@googlegroups.com
Hi everyone,

After a lot of digging I've given up on GAE's implementation of jaxws.
Their implementation can't be found by the Factory classloader, period.

So I've picked the Force.com Web Services Connector and managed to make it work.
There were bugs in the code generation process, in the generated code, and also the GAE connector needed some fixes.

I'm tempted to created a project on GitHub to show what I've done.
This implementation is faster and also you can set the socket timeout!

Cheers,
Emanuele

Phil

unread,
Sep 26, 2012, 10:53:16 AM9/26/12
to google-a...@googlegroups.com
Emmanuele, Could you more describe your solution?
I've a lot of problem with timeout exception and Jax-ws. I'm looking for new solution for substituing Jax-RS for calling web services.

Thanks
Deepak

To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.



--
Takashi Matsuo

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.



--
Deepak Singh

Emanuele Ziglioli

unread,
Sep 26, 2012, 5:51:28 PM9/26/12
to google-a...@googlegroups.com
Ok,

have you managed to generate any code with the SalesForce tool?
As I wrote, I did get an error but most of the code generated anyway. I'll post the command line options I used if I can find them.

The generated code contains three packages:

com.sforce.ws.transport
     GaeHttpTransport.java (this is not specific to any WSDL)

com.sforce.soap.types
     Many classes, mostly dependent on the WSDL, similar to the code generated by jaxws

com.sforce.soap.service.dataxmldistribution.... // followed by the URL of your WSDL
    Connector.java
    SoapConnection.java

This last package, as far as I recall, was the one that had some problems. I've attached Connector.java.
We've also made some proprietary changes to SoapConnection.
We're using the implementation in wsc-22.jar

Example of usage:
try {
      ConnectorConfig config = new ConnectorConfig();
      config.setTransport( GaeHttpTransport.class );
      config.setTraceMessage(true);
      config.setReadTimeout(7000);  // this is the important part
      SoapConnection connection = Connector.newConnection(config);
      String xmlres = connection.getXml( parameters );
}
catch (ConnectionException e) {
}

You really need to pass the first stage of code generation, don't worry about errors, see if anything at all has been generated, look at the command line options. Look at their source code and google for errors. Their source code shows more options that are not documented.

Hope that helps,
E.
Connector.java

Phil

unread,
Sep 27, 2012, 2:56:09 AM9/27/12
to google-a...@googlegroups.com
Thanks Emmanuel. Am I able to consume other web services with Force.Com or only the one of SaleForce?

I'm little bit confused of what is possible with Force.com.

By the way, Could you tell me if you know how to globally change the timeout of URL fetching in Google App Engine?

Thanks a lot.

Emanuele Ziglioli

unread,
Sep 27, 2012, 6:31:18 PM9/27/12
to google-a...@googlegroups.com


On Thursday, 27 September 2012 18:56:09 UTC+12, Phil wrote:
Thanks Emmanuel. Am I able to consume other web services with Force.Com or only the one of SaleForce?

Sure you can, any WSDL 

I'm little bit confused of what is possible with Force.com.


It's very much like jaxws, just simpler and faster, it sits on top of URLFetch 
 
By the way, Could you tell me if you know how to globally change the timeout of URL fetching in Google App Engine?


There's no way I know to change the timeout using jaxws. But you can using the salesforce code, see comments in the code I posted yesterday
Reply all
Reply to author
Forward
0 new messages