Created by potrace 1.10, written by Peter Selinger 2001-2011
Search - HWD Media
plg_search_content
Search - Tags
Log in
x
or
x
Register
x

or
  1. Menu
  2. Users
  3. Friends
  4. PUB
  • Members with avatar only
  • Match all criteria
  • Match any criteria
    Please login to view your friends
View All Members(61)

SOAP Request / Response using JavaScript

205
by admin, 9 months ago
0 0
function soapRequest(){
var str = 'your SOAP request';

function createCORSRequest(method, url) {
var xhr = new XMLHttpRequest();
if ("withCredentials" in xhr) {
xhr.open(method, url, false);
} else if (typeof XDomainRequest != "undefined") {
alert
xhr = new XDomainRequest();
xhr.open(method, url);
} else {
console.log("CORS not supported");
alert("CORS not supported");
xhr = null;
}
return xhr;
}
var xhr = createCORSRequest("POST", "http://localhost:8080");
if(!xhr){
console.log("XHR issue");
return;
}

xhr.onload = function (){
var results = xhr.responseText;
console.log(results);
}

xhr.setRequestHeader('Content-Type', 'text/xml');
xhr.send(str);
}
  1. Newest
  2. Related
  3. PUB