<script type="text/javascript" language="javascript"> var xmlHttp; function SoapCall() { // creatng the xmlHttp object if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlHttp = new XMLHttpRequest(); } else {// code for IE6, IE5 xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } // Calling the web service using post and true means asynchronous call xmlHttp.open("post", "http://www.webservicex.net/CurrencyConvertor.asmx", true); // Setting the request header to let the web service identify the soap request we would be sending xmlHttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8"); xmlHttp.setRequestHeader("Origin", "http://www.webserviceX.NET"); xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); // xmlHttp.setRequestHeader("Access-Control-Allow-Origin", "http://172.27.47.144"); xmlHttp.setRequestHeader("SOAPAction", "http://www.webserviceX.NET/ConversionRate"); var soapRequest = '<?xml version="1.0" encoding="utf-16"?>' + '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">' + '<soap:Body>' + '<ConversionRate xmlns="http://www.webserviceX.NET/">' + '<FromCurrency>USD</FromCurrency>' + '<ToCurrency>INR</ToCurrency>' + '</ConversionRate>' + '</soap:Body>' + '</soap:Envelope>'; xmlHttp.onreadystatechange = function () { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) { alert(xmlHttp.responseText); } } xmlHttp.send(soapRequest); } </script>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)