Note that there are some explanatory texts on larger screens.

plurals
  1. POSOAP Prototype Ajax SOAPAction Header question
    text
    copied!<p>So I am trying to make a request and pass in a SOAP object, the problem is that it comes back fine (onSuccess) but the responseXML is not there. I used Fiddler and HTTP Client (OSX version of fiddler) and input the same requests, boom, both back with the correct response. With prototype, not so much.</p> <p>I tried in the header and in the parameters fields...</p> <pre><code>&lt;script type="text/javascript" src="prototype.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function test(){ var body = '&lt;?xml version="1.0" encoding="utf-8"?&gt;' + '&lt;soap:Envelope' + ' xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"' + ' xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"' + ' xmlns:tns="urn:uvindexalert" xmlns:types="urn:uvindexalert/encodedTypes"' + ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' + ' xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;' + ' &lt;soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"&gt;' + ' &lt;tns:getUVIndexAlertByZipCode&gt;' + ' &lt;in0 xsi:type="xsd:string"&gt;92109&lt;/in0&gt;' + ' &lt;/tns:getUVIndexAlertByZipCode&gt;' + ' &lt;/soap:Body&gt;' + '&lt;/soap:Envelope&gt;'; var headers = ["SOAPAction", " ", "Content-Type", "text/xml"]; var request = new Ajax.Request("http://iaspub.epa.gov/uvindexalert/services/UVIndexAlertPort?wsdl", { contentType: "application/xml", requestHeaders: headers, parameters: "SOAPAction: ", postBody: body, onSuccess: function(response){ var j = 0; }, onFailure: function(){ var i = 0; } }); } test(); &lt;/script&gt; </code></pre> <p>The var i &amp; j are just so I know where it breaks so I can inspect it. I also looked online and noticed someone said try instead of text/xml application/xml then add charset=utf-8 so I did all that but still nothing. Anyone know for sure how to get back XML with a SOAPAction?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload