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.
I tried in the header and in the parameters fields...
<script type="text/javascript" src="prototype.js"></script>
<script type="text/javascript">
function test(){
var body = '<?xml version="1.0" encoding="utf-8"?>' +
'<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">' +
' <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">' +
' <tns:getUVIndexAlertByZipCode>' +
' <in0 xsi:type="xsd:string">92109</in0>' +
' </tns:getUVIndexAlertByZipCode>' +
' </soap:Body>' +
'</soap:Envelope>';
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();
</script>
The var i & 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?