This script uses $.ajax to send a SOAP:Envelope. It can take XML DOM, XML string or JSON as input and the response can be returned as either XML DOM, XML string or JSON too.
Some webservices only allow a request and do not provide a response (or possibly just a specific HTTP 2xx success code). I noticed that (in Chrome and Safari) the script runs into an error in such cases, because the xhr.responseXML property is null.
Uncaught Error: Unexpected Content: null
at SOAPResponse.toString (VM166 jquery.soap.js?_=1507333726234:478)
See this jsFiddle. It calls a static (non SOAP) PHP script that simulates the behaviour by just returning HTTP status code 202. When using the fiddle as-is (jquery.soap version 1.7.1), the JS browser console shows an error when running the fiddle. Replace the included script as indicated (add -patched) and the call succeeds.
Some webservices only allow a request and do not provide a response (or possibly just a specific HTTP 2xx success code). I noticed that (in Chrome and Safari) the script runs into an error in such cases, because the xhr.responseXML property is null.
See this jsFiddle. It calls a static (non SOAP) PHP script that simulates the behaviour by just returning HTTP status code 202. When using the fiddle as-is (jquery.soap version 1.7.1), the JS browser console shows an error when running the fiddle. Replace the included script as indicated (add -patched) and the call succeeds.