HTML page code:
<!DOCTYPE HTML Public "-//w3c//dtd XHTML 1.1//en" "Http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><HTMLxmlns= "http://www.w3.org/1999/xhtml"><Headrunat= "Server"> <title>JS Call WebService</title> <Scripttype= "Text/javascript"> functionRequestwebservice () {//This is the address of the Web service that we created in the first step varURL= "Http://192.168.210.51:8012/Service.asmx"; var Fun= "Getalldata"; //in this place we splice vardata; Data= '<?xml version= "1.0" encoding= "Utf-8"?>'; Data=Data+ '<soap12:envelope xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd= "http://www.w3.org/2001/ XmlSchema "xmlns:soap12=" Http://www.w3.org/2003/05/soap-envelope ">'; Data=Data+ '<soap12:Body>'; Data=Data+ '<' + Fun+ 'xmlns= "http://tempuri.org/" >'; Data=Data+ '<view>V_Gis_Mid_WasteWaterYearData</view>'; Data=Data+ '<condition>enterprisecode = 520100000238</condition>'; Data=Data+ '</' + Fun+ '>'; Data=Data+ '</soap12:Body>'; Data=Data+ '</soap12:Envelope>'; //Creating an Asynchronous object varXMLHTTP= NewActiveXObject ("Microsoft.XMLHTTP"); xmlHTTP. Open ("POST", URLs,false); xmlHTTP. setRequestHeader ("Content-type", "Application/soap+xml"); xmlHTTP. Send (data); document.getElementById ("Data"). InnerHTML=Xmlhttp.responsetext; } </Script></Head><Body> <Div> <inputID= "One"type= "button"value= "Jscallwebservice"onclick= "Requestwebservice ()" /> </Div> <DivID= "Data"> </Div></Body></HTML>