# Timeout when calling a web service

**URL:** <https://rubytalk.org/t/timeout-when-calling-a-web-service/18872>\
**Category:** ruby-talk\
**Created:** [9 June 2005 15:00 UTC](https://rubytalk.org/t/timeout-when-calling-a-web-service/18872 "2005-06-09T15:00:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Weiss\_Matt](https://avatars.discourse-cdn.com/v4/letter/w/e5b9ba/32.png) [@Weiss\_Matt](https://rubytalk.org/u/Weiss_Matt)\
**Post date:** [9 June 2005 15:00 UTC](https://rubytalk.org/t/timeout-when-calling-a-web-service/18872/1 "2005-06-09T15:00:28Z")

</div>

Hey all,

I'm a bit green to ruby so please bear with me as I learn 🙂

I'm trying to call a web service with ruby. This I have accomplished.  
I was able to create an SOAP::RPC::driver like so:

\<code\>  
wsdl = 'url to my wsdl'

driver = SOAP::RPC::Driver.new(wsdl,  
"[http://localhost:8080/axis/services/ServiceName?wsdl](http://localhost:8080/axis/services/ServiceName?wsdl)")

\</code\>

I was able to add web service methods like so...

\<code\>  
driver.add\_method("Method1", "in0")  
driver.add\_method("Method2", "in0")  
\</code\>

My problem is that one of my web service methods takes quite a bit of  
time to execute and my call is timing out. I reviewed the .rb files  
and I found that the default timeout is 30 seconds. How do I change  
the timeout in my driver object or in one of my methods?

Thanks in advance,  
Matt

---

<div class="post-metadata">

**Author:** ![NAKAMURA\_Hiroshi4](https://avatars.discourse-cdn.com/v4/letter/n/3ab097/32.png) [@NAKAMURA\_Hiroshi4](https://rubytalk.org/u/NAKAMURA_Hiroshi4)\
**Post date:** [16 July 2005 09:51 UTC](https://rubytalk.org/t/timeout-when-calling-a-web-service/18872/2 "2005-07-16T09:51:58Z")

</div>

Hi,

Sorry for late reply. I've not read ruby-talk these days.

> **···**
>
> weiss.matt@gmail.com wrote:
> 
> > My problem is that one of my web service methods takes quite a bit of  
> > time to execute and my call is timing out. I reviewed the .rb files  
> > and I found that the default timeout is 30 seconds. How do I change  
> > the timeout in my driver object or in one of my methods?
> 
> &nbsp;&nbsp;driver.options["protocol.http.connect\_timeout"] = 999  
> &nbsp;&nbsp;driver.options["protocol.http.send\_timeout"] = 999  
> &nbsp;&nbsp;driver.options["protocol.http.receive\_timeout"] = 999
> 
> should work. cf. [http://dev.ctor.org/soap4r/ticket/40](http://dev.ctor.org/soap4r/ticket/40)
> 
> Regards,  
> // NaHi
