Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

setTimeout don

Hello,

I try to set the Iphone Timeout more than 10 seconds but it don't work.
I call a webServices with the file suds.js, the same of the KitchenSink so I do that :

xhr.open('POST',config.endpoint); xhr.setTimeout([30000]); xhr.setRequestHeader('Content-Type', 'text/xml'); xhr.setRequestHeader('SOAPAction', soapAction); 
xhr.send(config.envelopeBegin+body+config.envelopeEnd);

But after 10 seconds, the automatic loader on the Iphone stop to search. I don't understand.

How can I set the Iphone Timeout ?

Regards,

— asked October 15th 2010 by Remi Delcourt
  • timeout
0 Comments

1 Answer

  • setTimeOut and setRequestHeader MUST be called before open. Also it's not necessary to wrap the duration in [] in setTimeOut

    xhr.setTimeout(30000);
    xhr.setRequestHeader('Content-Type', 'text/xml'); 
    xhr.setRequestHeader('SOAPAction', soapAction); 
    xhr.open('POST',config.endpoint); 
    xhr.send(config.envelopeBegin+body+config.envelopeEnd);
    
    — answered October 15th 2010 by John McKnight
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.