0

I'm working with SOAP (web services). Let me explain. When I send a call to the SOAP (through PHP), sometimes doesn't respond nothing... and it keeps there doing nothing. What I need is to find a way to control the response time, so after a few seconds just pass to other execution. My idea is to use some high level js code (because I've used jquery/ajax/json in the whole app) or in the same way but with php code at the same place, something like when the SOAP is called, if it doesn't send any response after a few seconds (Ex: 15s), try to control that with any method or variable... (Sort of timer but in PHP).

I look forward to any suggestions or ideas!

vyplow
  • 69
  • 1
  • 2
  • 10
  • Use `.abort()`. See: http://stackoverflow.com/questions/446594/abort-ajax-requests-using-jquery – Halcyon Feb 24 '15 at 18:35
  • Excellent. What I really need now is how to control that but in time! (Ex: 20 secs). The idea is if it doesn't finish before that time, .abort() is launched. – vyplow Feb 24 '15 at 18:55
  • You can use `setTimeout` to schedule a timer. Clear the timer with `var timer = setTimeout(doabort, 30000); clearTimeout(timer);` in case the request succeeded. – Halcyon Feb 25 '15 at 12:19
  • I'll see what can I do with that variable... – vyplow Feb 25 '15 at 12:38

0 Answers0