Thread

Posted on Wed Apr 30 18:25:54 2008 by oly
Modify default timeout
Hi,

I could not find documentation on how to set a given timeout in a client. I was using
$soap->proxy($proxy, timeout => 1000);
previously. But this relied on SOAP::Lite, isn't it? Is it still possible with SOAP::WSDL 2 ?

Olivier
Direct Responses: 7808 | Write a response
Posted on Sat May 3 03:01:44 2008 by noah in response to 7799
Re: Modify default timeout
A proxy() method is provided for backwards compatibility; running this:
my $soap = MyInterfaces::MyService::ServicePort->new(); $soap->proxy($proxy, timeout => 1);
...against simple server which sleeps for 5 seconds when processing a request results in a timeout after ~1s. If you wish to bypass the backward compatibility, you can do retrieve the transport object and set the timeout on it, like this:
my $soap = MyInterfaces::MyService::ServicePort->new(); $soap->get_transport()->timeout(1);
Noah
Direct Responses: 7911 | 7928 | Write a response
Posted on Tue May 20 16:23:56 2008 by oly in response to 7808
Re: Modify default timeout
Great, it works. Thanks!
Write a response
Posted on Sun May 25 22:32:27 2008 by drfrog in response to 7808
Re: Modify default timeout
i too would like to set the timeout. im not using the full interface though. if im making a call like this:
my $service = SOAP::WSDL->new( wsdl => $wsdl );
how would i get/set the timeout off of that? ive looked around and cant seem to find anything relevant. thanks
Direct Responses: 7930 | Write a response
Posted on Sun May 25 23:32:41 2008 by mkutter in response to 7928
Re: Modify default timeout
I actually missed this - you need a fixed version of SOAP/WSDL.pm from http://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL.pm With this version, you can set the timeout by passing additional arguments to the proxy() or set_proxy() methods like
my $soap = SOAP::WSDL->new( wsdl => 'WSDL.wsdl'); $soap->proxy('http://example.org', timeout => 512);
Martin
Direct Responses: 7934 | Write a response
Posted on Mon May 26 01:16:00 2008 by drfrog in response to 7930
Re: Modify default timeout
hmm i wasnt setting the proxy. this is an extra step is there anyway to get this to by like
my $soap = SOAP::WSDL->new( wsdl => 'WSDL.wsdl' , timeout=> 120); ps: since i need to set the proxy.. is the proxy always the root of the wsdl? for instance the wsdl https://im.a.website.com/servicedir/wsdl/wsdl.wsdl would be https://im.a.website.com/servicedir
Direct Responses: 7940 | Write a response
Posted on Mon May 26 21:54:09 2008 by mkutter in response to 7934
Re: Modify default timeout
Ah, no, the proxy is actually the soap:address location attribute from the port definition like this:
<wsdl:port name="NewPort" binding="tns:NewBinding"> <soap:address location="http://www.example.org/"></soap:address> </wsdl:port>
You can set the timeout like this, too (only with the updated SOAP::WSDL):
$soap->wsdlinit(); $soap->get_client()->get_transport()->timeout(360);
Direct Responses: 7948 | Write a response
Posted on Tue May 27 20:54:28 2008 by drfrog in response to 7940
Re: Modify default timeout
when are those changes going to hit cpan? also can one do this (with your updated WSDL.pm): my $soap=SOAP::WSDL->new(wsdl=>$wsdl); $soap->wsdlinit(); $soap->get_client()->get_transport()->timeout(360);
Direct Responses: 7949 | Write a response
Posted on Tue May 27 22:08:20 2008 by mkutter in response to 7948
Re: Modify default timeout
... usually within a week or two - it just depends on how much spare time I have, and how boring the rest of my life is (should I note that there *is* a life ? ;-)
Write a response