<script type="text/jscript" language="javascript"> var xmlHttp; function SoapCall() { // creatng the xmlHttp object var xmlHttp; 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", false); // 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("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>AFA</FromCurrency>' + '<ToCurrency>AFA</ToCurrency>' + '</ConversionRate>' + '</soap:Body>' + '</soap:Envelope>'; xmlHttp.send(soapRequest); alert(xmlHttp.responseText); } </script>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)