Perfect - thank you!

On Jan 18, 7:54 pm, "Nick Johnson (Google)" <nick.john...@google.com>
wrote:
> Hi Jawon,
>
> You can do this by using an API call hook, like so:
>
> def urlfetch_timeout_hook(service, call, request, response):
>   if call != 'Fetch':
>     return
>   # Make the default deadline 10 seconds instead of 5.
>   if not request.has_deadline():
>     request.set_deadline(10.0)
>
> apiproxy_stub_map.apiproxy.GetPreCallHooks().Append(
>     'urlfetch_timeout_hook', urlfetch_timeout_hook, 'urlfetch')
>
>
>
>
>
>
>
>
>
> On Wed, Jan 19, 2011 at 2:41 PM, Jawon <jawonl...@gmail.com> wrote:
> > Hi,
> > My app (in Python) uses the ZSI SOAP library to make SOAP calls to an
> > external server that is not under my control. From what I can tell,
> > the SOAP requests take about 5 seconds - enough that I consistently
> > run into the 5 second deadline of GAE's urlfetch. Because I'm using
> > the ZSI library, I am unclear about where the urlfetch request call is
> > being made, although I do have access to the source code. Is there a
> > way to override the default deadline of the urlfetch library?
>
> > Here is the error log:
> > ApplicationError: 5
> > Traceback (most recent call last):
> >  File "/base/python_runtime/python_lib/versions/1/google/appengine/
> > ext/webapp/__init__.py", line 517, in __call__
> >    handler.post(*groups)
> >  File "/base/data/home/apps/opalapp/1.3477302363 <tel:+13477302363>
> > 97102974/
> > handlers.py", line 162, in post
> >    res = c.launchJob(cmd_args, inputs)
> >  File "/base/data/home/apps/opalapp/1.3477302363 <tel:+13477302363>
> > 97102974/
> > opalclient.py", line 122, in launchJob
> >    resp = self.appServicePort.launchJob(req)
> >  File "./client/AppService_client.py", line 60, in launchJob
> >    response = self.binding.Receive(launchJobResponse.typecode)
> >  File "./client/ZSI/client.py", line 545, in Receive
> >    self.ReceiveSOAP(**kw)
> >  File "./client/ZSI/client.py", line 428, in ReceiveSOAP
> >    if not self.IsSOAP():
> >  File "./client/ZSI/client.py", line 420, in IsSOAP
> >    self.ReceiveRaw()
> >  File "./client/ZSI/client.py", line 387, in ReceiveRaw
> >    response = self.h.getresponse()
> >  File "/base/python_runtime/python_dist/lib/python2.5/httplib.py",
> > line 197, in getresponse
> >    self._allow_truncated, self._follow_redirects)
> >  File "/base/python_runtime/python_lib/versions/1/google/appengine/
> > api/urlfetch.py", line 241, in fetch
> >    return rpc.get_result()
> >  File "/base/python_runtime/python_lib/versions/1/google/appengine/
> > api/apiproxy_stub_map.py", line 530, in get_result
> >    return self.__get_result_hook(self)
> >  File "/base/python_runtime/python_lib/versions/1/google/appengine/
> > api/urlfetch.py", line 331, in _get_fetch_result
> >    raise DownloadError(str(err))
> > DownloadError: ApplicationError: 5
>
> > Thank you,
> > Jawon Lee
>
> > --
> > 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+unsubscr...@googlegroups.com<google-appengine%2Bunsubscrib 
> > e...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine?hl=en.
>
> --
> Nick Johnson, Developer Programs Engineer, App Engine
> Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number:
> 368047

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to