Hi
My service takes ~5 minutes time. When I call it, I get:
Traceback (most recent call last): File "test_soap_global2.py", line 2151, in <module> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in __call__ File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in invoke File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 85, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 107, in __open File "/usr/lib/python2.6/urllib2.py", line 389, in open response = self._open(req, data) File "/usr/lib/python2.6/urllib2.py", line 407, in _open '_open', req) File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain result = func(*args) File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open raise URLError(err) urllib2.URLError: <urlopen error timed out>
Jerzy Orlowski
I'm not sure if this will work for you, it may be worth a shot - see the 'missing manual' for urllib2, which shows you a way to set global socket options: ######################### import socket import urllib2
# timeout in seconds timeout = 10 socket.setdefaulttimeout(timeout)
# this call to urllib2.urlopen now uses the default timeout # we have set in the socket module req = urllib2.Request('http://www.voidspace.org.uk') response = urllib2.urlopen(req) ########################
Something like this in your Suds script may help, and is worth a shot.
Please post back if this works, and good luck! -Matt
On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski jerzyo@genesilico.pl wrote:
Hi
My service takes ~5 minutes time. When I call it, I get:
Traceback (most recent call last): File "test_soap_global2.py", line 2151, in <module> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in __call__ File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in invoke File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 85, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 107, in __open File "/usr/lib/python2.6/urllib2.py", line 389, in open response = self._open(req, data) File "/usr/lib/python2.6/urllib2.py", line 407, in _open '_open', req) File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain result = func(*args) File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open raise URLError(err) urllib2.URLError: <urlopen error timed out>
Jerzy Orlowski
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
I've already tried it and it does not work. This was a temporary hack and is not supported
Is it possible to set a default timeout in suds when calling urllib2.open()?
Jerzy
Matt C wrote:
I'm not sure if this will work for you, it may be worth a shot - see the 'missing manual' for urllib2, which shows you a way to set global socket options: ######################### import socket import urllib2
# timeout in seconds timeout = 10 socket.setdefaulttimeout(timeout)
# this call to urllib2.urlopen now uses the default timeout # we have set in the socket module req = urllib2.Request('http://www.voidspace.org.uk') response = urllib2.urlopen(req) ########################
Something like this in your Suds script may help, and is worth a shot.
Please post back if this works, and good luck! -Matt
On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski jerzyo@genesilico.pl wrote:
Hi
My service takes ~5 minutes time. When I call it, I get:
Traceback (most recent call last): File "test_soap_global2.py", line 2151, in <module> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in __call__ File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in invoke File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 85, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 107, in __open File "/usr/lib/python2.6/urllib2.py", line 389, in open response = self._open(req, data) File "/usr/lib/python2.6/urllib2.py", line 407, in _open '_open', req) File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain result = func(*args) File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open raise URLError(err) urllib2.URLError: <urlopen error timed out>
Jerzy Orlowski
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
I think it may have to do with this.
In [24]: urllib2.socket.setdefaulttimeout ? Type: builtin_function_or_method Base Class: <type 'builtin_function_or_method'> String Form: <built-in function setdefaulttimeout> Namespace: Interactive Docstring: setdefaulttimeout(timeout)
Set the default timeout in floating seconds for new socket objects. A value of None indicates that new socket objects have no timeout. When the socket module is first imported, the default is None. #########
So if the default timeout is set to none, you're likely stuck dealing with the default TCP/IP socket timeouts on the OS.
-Matt
On Fri, Nov 20, 2009 at 10:38 AM, Jerzy Orlowski jerzyo@genesilico.pl wrote:
I've already tried it and it does not work. This was a temporary hack and is not supported
Is it possible to set a default timeout in suds when calling urllib2.open()?
Jerzy
Matt C wrote:
I'm not sure if this will work for you, it may be worth a shot - see the 'missing manual' for urllib2, which shows you a way to set global socket options: ######################### import socket import urllib2
# timeout in seconds timeout = 10 socket.setdefaulttimeout(timeout)
# this call to urllib2.urlopen now uses the default timeout # we have set in the socket module req = urllib2.Request('http://www.voidspace.org.uk') response = urllib2.urlopen(req) ########################
Something like this in your Suds script may help, and is worth a shot.
Please post back if this works, and good luck! -Matt
On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski jerzyo@genesilico.pl wrote:
Hi
My service takes ~5 minutes time. When I call it, I get:
Traceback (most recent call last): File "test_soap_global2.py", line 2151, in <module> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in __call__ File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in invoke File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 85, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 107, in __open File "/usr/lib/python2.6/urllib2.py", line 389, in open response = self._open(req, data) File "/usr/lib/python2.6/urllib2.py", line 407, in _open '_open', req) File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain result = func(*args) File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open raise URLError(err) urllib2.URLError: <urlopen error timed out>
Jerzy Orlowski
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
changing the http.py file made it:
def __open(self, u2request): socket.setdefaulttimeout(self.options.timeout) if self.urlopener is None: return u2.urlopen(u2request) else: return self.urlopener.open(u2request,timeout=500)
Could you, please, add Client.settimout()
For the the next release?
Matt C wrote:
I'm not sure if this will work for you, it may be worth a shot - see the 'missing manual' for urllib2, which shows you a way to set global socket options: ######################### import socket import urllib2
# timeout in seconds timeout = 10 socket.setdefaulttimeout(timeout)
# this call to urllib2.urlopen now uses the default timeout # we have set in the socket module req = urllib2.Request('http://www.voidspace.org.uk') response = urllib2.urlopen(req) ########################
Something like this in your Suds script may help, and is worth a shot.
Please post back if this works, and good luck! -Matt
On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski jerzyo@genesilico.pl wrote:
Hi
My service takes ~5 minutes time. When I call it, I get:
Traceback (most recent call last): File "test_soap_global2.py", line 2151, in <module> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in __call__ File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in invoke File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 85, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 107, in __open File "/usr/lib/python2.6/urllib2.py", line 389, in open response = self._open(req, data) File "/usr/lib/python2.6/urllib2.py", line 407, in _open '_open', req) File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain result = func(*args) File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open raise URLError(err) urllib2.URLError: <urlopen error timed out>
Jerzy Orlowski
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
The socket timeout was added as a suds option in 0.3.7 (https://fedorahosted.org/suds/wiki/Documentation#OPTIONS). Try:
client = Client(url, timeout=500)
On 11/20/2009 09:44 AM, Jerzy Orlowski wrote:
changing the http.py file made it:
def __open(self, u2request): socket.setdefaulttimeout(self.options.timeout) if self.urlopener is None: return u2.urlopen(u2request) else: return self.urlopener.open(u2request,timeout=500)
Could you, please, add Client.settimout()
For the the next release?
Matt C wrote:
I'm not sure if this will work for you, it may be worth a shot - see the 'missing manual' for urllib2, which shows you a way to set global socket options: ######################### import socket import urllib2
# timeout in seconds timeout = 10 socket.setdefaulttimeout(timeout)
# this call to urllib2.urlopen now uses the default timeout # we have set in the socket module req = urllib2.Request('http://www.voidspace.org.uk') response = urllib2.urlopen(req) ########################
Something like this in your Suds script may help, and is worth a shot.
Please post back if this works, and good luck! -Matt
On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski jerzyo@genesilico.pl wrote:
Hi
My service takes ~5 minutes time. When I call it, I get:
Traceback (most recent call last): File "test_soap_global2.py", line 2151, in <module> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in __call__ File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in invoke File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 85, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 107, in __open File "/usr/lib/python2.6/urllib2.py", line 389, in open response = self._open(req, data) File "/usr/lib/python2.6/urllib2.py", line 407, in _open '_open', req) File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain result = func(*args) File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open raise URLError(err) urllib2.URLError: <urlopen error timed out>
Jerzy Orlowski
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
OK,it works, but if you do it by socket.setdefaulttimeout(self.options.timeout) than it is very nasty and error prone
The proper code should look stk like: def __open(self, u2request): #socket.setdefaulttimeout(self.options.timeout) if self.urlopener is None: return u2.urlopen(u2request,self.options.timeout) else: return self.urlopener.open(u2request,self.options.timeout)
Jeff Ortel wrote:
The socket timeout was added as a suds option in 0.3.7 (https://fedorahosted.org/suds/wiki/Documentation#OPTIONS). Try:
client = Client(url, timeout=500)
On 11/20/2009 09:44 AM, Jerzy Orlowski wrote:
changing the http.py file made it:
def __open(self, u2request): socket.setdefaulttimeout(self.options.timeout) if self.urlopener is None: return u2.urlopen(u2request) else: return self.urlopener.open(u2request,timeout=500)
Could you, please, add Client.settimout()
For the the next release?
Matt C wrote:
I'm not sure if this will work for you, it may be worth a shot - see the 'missing manual' for urllib2, which shows you a way to set global socket options: ######################### import socket import urllib2
# timeout in seconds timeout = 10 socket.setdefaulttimeout(timeout)
# this call to urllib2.urlopen now uses the default timeout # we have set in the socket module req = urllib2.Request('http://www.voidspace.org.uk') response = urllib2.urlopen(req) ########################
Something like this in your Suds script may help, and is worth a shot.
Please post back if this works, and good luck! -Matt
On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski jerzyo@genesilico.pl wrote:
Hi
My service takes ~5 minutes time. When I call it, I get:
Traceback (most recent call last): File "test_soap_global2.py", line 2151, in <module> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in __call__ File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in invoke File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 85, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 107, in __open File "/usr/lib/python2.6/urllib2.py", line 389, in open response = self._open(req, data) File "/usr/lib/python2.6/urllib2.py", line 407, in _open '_open', req) File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain result = func(*args) File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open raise URLError(err) urllib2.URLError: <urlopen error timed out>
Jerzy Orlowski
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
Sorry, this one doesn't work. And it seems that socket.setdefaulttimeout(self.options.timeout in http.py is not changing anything
Jerzy Orlowski
Jerzy Orlowski wrote:
OK,it works, but if you do it by socket.setdefaulttimeout(self.options.timeout) than it is very nasty and error prone
The proper code should look stk like: def __open(self, u2request): #socket.setdefaulttimeout(self.options.timeout) if self.urlopener is None: return u2.urlopen(u2request,self.options.timeout) else: return self.urlopener.open(u2request,self.options.timeout)
Jeff Ortel wrote:
The socket timeout was added as a suds option in 0.3.7 (https://fedorahosted.org/suds/wiki/Documentation#OPTIONS). Try:
client = Client(url, timeout=500)
On 11/20/2009 09:44 AM, Jerzy Orlowski wrote:
changing the http.py file made it:
def __open(self, u2request): socket.setdefaulttimeout(self.options.timeout) if self.urlopener is None: return u2.urlopen(u2request) else: return self.urlopener.open(u2request,timeout=500)
Could you, please, add Client.settimout()
For the the next release?
Matt C wrote:
I'm not sure if this will work for you, it may be worth a shot - see the 'missing manual' for urllib2, which shows you a way to set global socket options: ######################### import socket import urllib2
# timeout in seconds timeout = 10 socket.setdefaulttimeout(timeout)
# this call to urllib2.urlopen now uses the default timeout # we have set in the socket module req = urllib2.Request('http://www.voidspace.org.uk') response = urllib2.urlopen(req) ########################
Something like this in your Suds script may help, and is worth a shot.
Please post back if this works, and good luck! -Matt
On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski jerzyo@genesilico.pl wrote:
Hi
My service takes ~5 minutes time. When I call it, I get:
Traceback (most recent call last): File "test_soap_global2.py", line 2151, in <module> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in __call__ File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in invoke File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 85, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 107, in __open File "/usr/lib/python2.6/urllib2.py", line 389, in open response = self._open(req, data) File "/usr/lib/python2.6/urllib2.py", line 407, in _open '_open', req) File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain result = func(*args) File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open raise URLError(err) urllib2.URLError: <urlopen error timed out>
Jerzy Orlowski
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
On 11/20/2009 10:19 AM, Jerzy Orlowski wrote:
Sorry, this one doesn't work. And it seems that socket.setdefaulttimeout(self.options.timeout in http.py is not changing anything
How so? Worked when I tested it.
Jerzy Orlowski
Jerzy Orlowski wrote:
OK,it works, but if you do it by socket.setdefaulttimeout(self.options.timeout) than it is very nasty and error prone
The proper code should look stk like: def __open(self, u2request): #socket.setdefaulttimeout(self.options.timeout) if self.urlopener is None: return u2.urlopen(u2request,self.options.timeout) else: return self.urlopener.open(u2request,self.options.timeout)
Jeff Ortel wrote:
The socket timeout was added as a suds option in 0.3.7 (https://fedorahosted.org/suds/wiki/Documentation#OPTIONS). Try:
client = Client(url, timeout=500)
On 11/20/2009 09:44 AM, Jerzy Orlowski wrote:
changing the http.py file made it:
def __open(self, u2request): socket.setdefaulttimeout(self.options.timeout) if self.urlopener is None: return u2.urlopen(u2request) else: return self.urlopener.open(u2request,timeout=500)
Could you, please, add Client.settimout()
For the the next release?
Matt C wrote:
I'm not sure if this will work for you, it may be worth a shot - see the 'missing manual' for urllib2, which shows you a way to set global socket options: ######################### import socket import urllib2
# timeout in seconds timeout = 10 socket.setdefaulttimeout(timeout)
# this call to urllib2.urlopen now uses the default timeout # we have set in the socket module req = urllib2.Request('http://www.voidspace.org.uk') response = urllib2.urlopen(req) ########################
Something like this in your Suds script may help, and is worth a shot.
Please post back if this works, and good luck! -Matt
On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski jerzyo@genesilico.pl wrote:
Hi
My service takes ~5 minutes time. When I call it, I get:
Traceback (most recent call last): File "test_soap_global2.py", line 2151, in <module> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in __call__ File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in invoke File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 85, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 107, in __open File "/usr/lib/python2.6/urllib2.py", line 389, in open response = self._open(req, data) File "/usr/lib/python2.6/urllib2.py", line 407, in _open '_open', req) File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain result = func(*args) File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open raise URLError(err) urllib2.URLError: <urlopen error timed out>
Jerzy Orlowski
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
Works
Thanks a lot guys for quick reply! Could you put it on Tips & Trics (just for future generations)
Jerzy
Jeff Ortel wrote:
On 11/20/2009 10:19 AM, Jerzy Orlowski wrote:
Sorry, this one doesn't work. And it seems that socket.setdefaulttimeout(self.options.timeout in http.py is not changing anything
How so? Worked when I tested it.
Jerzy Orlowski
Jerzy Orlowski wrote:
OK,it works, but if you do it by socket.setdefaulttimeout(self.options.timeout) than it is very nasty and error prone
The proper code should look stk like: def __open(self, u2request): #socket.setdefaulttimeout(self.options.timeout) if self.urlopener is None: return u2.urlopen(u2request,self.options.timeout) else: return self.urlopener.open(u2request,self.options.timeout)
Jeff Ortel wrote:
The socket timeout was added as a suds option in 0.3.7 (https://fedorahosted.org/suds/wiki/Documentation#OPTIONS). Try:
client = Client(url, timeout=500)
On 11/20/2009 09:44 AM, Jerzy Orlowski wrote:
changing the http.py file made it:
def __open(self, u2request): socket.setdefaulttimeout(self.options.timeout) if self.urlopener is None: return u2.urlopen(u2request) else: return self.urlopener.open(u2request,timeout=500)
Could you, please, add Client.settimout()
For the the next release?
Matt C wrote:
I'm not sure if this will work for you, it may be worth a shot - see the 'missing manual' for urllib2, which shows you a way to set global socket options: ######################### import socket import urllib2
# timeout in seconds timeout = 10 socket.setdefaulttimeout(timeout)
# this call to urllib2.urlopen now uses the default timeout # we have set in the socket module req = urllib2.Request('http://www.voidspace.org.uk') response = urllib2.urlopen(req) ########################
Something like this in your Suds script may help, and is worth a shot.
Please post back if this works, and good luck! -Matt
On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski jerzyo@genesilico.pl wrote: > Hi > > My service takes ~5 minutes time. When I call it, I get: > > Traceback (most recent call last): > File "test_soap_global2.py", line 2151, in <module> > result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, > TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) > File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in > __call__ > File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in > invoke > File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in > send > File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line > 85, in > send > File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line > 107, in > __open > File "/usr/lib/python2.6/urllib2.py", line 389, in open > response = self._open(req, data) > File "/usr/lib/python2.6/urllib2.py", line 407, in _open > '_open', req) > File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain > result = func(*args) > File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open > return self.do_open(httplib.HTTPConnection, req) > File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open > raise URLError(err) > urllib2.URLError: <urlopen error timed out> > > > Jerzy Orlowski > > _______________________________________________ > fedora-suds-list mailing list > fedora-suds-list@redhat.com > https://www.redhat.com/mailman/listinfo/fedora-suds-list >
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
On 11/20/2009 10:16 AM, Jerzy Orlowski wrote:
OK,it works, but if you do it by socket.setdefaulttimeout(self.options.timeout) than it is very nasty and error prone
Again, /timeout/ arg was not added to urllib2 open() methods until python 2.6.
The proper code should look stk like: def __open(self, u2request): #socket.setdefaulttimeout(self.options.timeout) if self.urlopener is None: return u2.urlopen(u2request,self.options.timeout) else: return self.urlopener.open(u2request,self.options.timeout)
Jeff Ortel wrote:
The socket timeout was added as a suds option in 0.3.7 (https://fedorahosted.org/suds/wiki/Documentation#OPTIONS). Try:
client = Client(url, timeout=500)
On 11/20/2009 09:44 AM, Jerzy Orlowski wrote:
changing the http.py file made it:
def __open(self, u2request): socket.setdefaulttimeout(self.options.timeout) if self.urlopener is None: return u2.urlopen(u2request) else: return self.urlopener.open(u2request,timeout=500)
Could you, please, add Client.settimout()
For the the next release?
Matt C wrote:
I'm not sure if this will work for you, it may be worth a shot - see the 'missing manual' for urllib2, which shows you a way to set global socket options: ######################### import socket import urllib2
# timeout in seconds timeout = 10 socket.setdefaulttimeout(timeout)
# this call to urllib2.urlopen now uses the default timeout # we have set in the socket module req = urllib2.Request('http://www.voidspace.org.uk') response = urllib2.urlopen(req) ########################
Something like this in your Suds script may help, and is worth a shot.
Please post back if this works, and good luck! -Matt
On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski jerzyo@genesilico.pl wrote:
Hi
My service takes ~5 minutes time. When I call it, I get:
Traceback (most recent call last): File "test_soap_global2.py", line 2151, in <module> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in __call__ File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in invoke File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 85, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 107, in __open File "/usr/lib/python2.6/urllib2.py", line 389, in open response = self._open(req, data) File "/usr/lib/python2.6/urllib2.py", line 407, in _open '_open', req) File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain result = func(*args) File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open raise URLError(err) urllib2.URLError: <urlopen error timed out>
Jerzy Orlowski
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
On 11/20/2009 11:05 AM, Jeff Ortel wrote:
On 11/20/2009 10:16 AM, Jerzy Orlowski wrote:
OK,it works, but if you do it by socket.setdefaulttimeout(self.options.timeout) than it is very nasty and error prone
Again, /timeout/ arg was not added to urllib2 open() methods until python 2.6.
Probably would be nicer to test the u2.__version__ and use the timeout on the urlopener.open() instead if supported.
The proper code should look stk like: def __open(self, u2request): #socket.setdefaulttimeout(self.options.timeout) if self.urlopener is None: return u2.urlopen(u2request,self.options.timeout) else: return self.urlopener.open(u2request,self.options.timeout)
Jeff Ortel wrote:
The socket timeout was added as a suds option in 0.3.7 (https://fedorahosted.org/suds/wiki/Documentation#OPTIONS). Try:
client = Client(url, timeout=500)
On 11/20/2009 09:44 AM, Jerzy Orlowski wrote:
changing the http.py file made it:
def __open(self, u2request): socket.setdefaulttimeout(self.options.timeout) if self.urlopener is None: return u2.urlopen(u2request) else: return self.urlopener.open(u2request,timeout=500)
Could you, please, add Client.settimout()
For the the next release?
Matt C wrote:
I'm not sure if this will work for you, it may be worth a shot - see the 'missing manual' for urllib2, which shows you a way to set global socket options: ######################### import socket import urllib2
# timeout in seconds timeout = 10 socket.setdefaulttimeout(timeout)
# this call to urllib2.urlopen now uses the default timeout # we have set in the socket module req = urllib2.Request('http://www.voidspace.org.uk') response = urllib2.urlopen(req) ########################
Something like this in your Suds script may help, and is worth a shot.
Please post back if this works, and good luck! -Matt
On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski jerzyo@genesilico.pl wrote:
Hi
My service takes ~5 minutes time. When I call it, I get:
Traceback (most recent call last): File "test_soap_global2.py", line 2151, in <module> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in __call__ File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in invoke File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 85, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 107, in __open File "/usr/lib/python2.6/urllib2.py", line 389, in open response = self._open(req, data) File "/usr/lib/python2.6/urllib2.py", line 407, in _open '_open', req) File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain result = func(*args) File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open raise URLError(err) urllib2.URLError: <urlopen error timed out>
Jerzy Orlowski
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
And I see why it doesn't work:
You change the default timeout in /transport/http.py __open function This overrides the change you suggest
You should not that this is a very nasty way of setting the timeouts. For example this might affect another modules that are inside the program
Jerzy
Matt C wrote:
I'm not sure if this will work for you, it may be worth a shot - see the 'missing manual' for urllib2, which shows you a way to set global socket options: ######################### import socket import urllib2
# timeout in seconds timeout = 10 socket.setdefaulttimeout(timeout)
# this call to urllib2.urlopen now uses the default timeout # we have set in the socket module req = urllib2.Request('http://www.voidspace.org.uk') response = urllib2.urlopen(req) ########################
Something like this in your Suds script may help, and is worth a shot.
Please post back if this works, and good luck! -Matt
On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski jerzyo@genesilico.pl wrote:
Hi
My service takes ~5 minutes time. When I call it, I get:
Traceback (most recent call last): File "test_soap_global2.py", line 2151, in <module> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in __call__ File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in invoke File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 85, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 107, in __open File "/usr/lib/python2.6/urllib2.py", line 389, in open response = self._open(req, data) File "/usr/lib/python2.6/urllib2.py", line 407, in _open '_open', req) File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain result = func(*args) File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open raise URLError(err) urllib2.URLError: <urlopen error timed out>
Jerzy Orlowski
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
On 11/20/2009 09:55 AM, Jerzy Orlowski wrote:
And I see why it doesn't work:
You change the default timeout in /transport/http.py __open function This overrides the change you suggest
You should not that this is a very nasty way of setting the timeouts. For example this might affect another modules that are inside the program
I completely agree but setting the timeout in urllib2 was not added until recently. So, the socket.setdefaulttimeout() is used for backward compatibility for older versions of python. Thoughts?
Jerzy
Matt C wrote:
I'm not sure if this will work for you, it may be worth a shot - see the 'missing manual' for urllib2, which shows you a way to set global socket options: ######################### import socket import urllib2
# timeout in seconds timeout = 10 socket.setdefaulttimeout(timeout)
# this call to urllib2.urlopen now uses the default timeout # we have set in the socket module req = urllib2.Request('http://www.voidspace.org.uk') response = urllib2.urlopen(req) ########################
Something like this in your Suds script may help, and is worth a shot.
Please post back if this works, and good luck! -Matt
On Fri, Nov 20, 2009 at 10:10 AM, Jerzy Orlowski jerzyo@genesilico.pl wrote:
Hi
My service takes ~5 minutes time. When I call it, I get:
Traceback (most recent call last): File "test_soap_global2.py", line 2151, in <module> result=client.service.soap_create_model(INPUT_PDB, INPUT_ALIGNMENT, TEMP_CHAIN_NAME, MODEL_CHAIN_NAME) File "build/bdist.linux-x86_64/egg/suds/client.py", line 537, in __call__ File "build/bdist.linux-x86_64/egg/suds/client.py", line 597, in invoke File "build/bdist.linux-x86_64/egg/suds/client.py", line 622, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 85, in send File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 107, in __open File "/usr/lib/python2.6/urllib2.py", line 389, in open response = self._open(req, data) File "/usr/lib/python2.6/urllib2.py", line 407, in _open '_open', req) File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain result = func(*args) File "/usr/lib/python2.6/urllib2.py", line 1146, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open raise URLError(err) urllib2.URLError: <urlopen error timed out>
Jerzy Orlowski
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list