1. Call WebService in JavaScript
<Script language = "javascript">
Function PostRequestData (URL, data ){
Var xmlhttp = new ActiveXObject ("Microsoft. XMLHTTP ");
Xmlhttp. Open ("POST", URL, false );
Xmlhttp. SetRequestHeader ("Content-Type", "text/xml; charset = UTF-8 ");
Xmlhttp. SetRequestHeader ("SOAPAction", "http://tempuri.org/myService/test/isNumner ");
Try {
Xmlhttp. Send (data );
Var result = xmlhttp. status;
}
Catch (ex ){
Return ("0" + ex. description + "|" + ex. number );
}
If (result = 200 ){
Return ("1" + xmlhttp. responseText );
}
Xmlhttp = null;
}
Function loadit (value ){
Var url = 'HTTP: // localhost/myService/test. asmx ';
Var data;
Var r;
Data = '<? Xml version = "1.0" encoding = "UTF-8"?> ';
Data = data + '<soap: Envelope xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns: xsd = "http://www.w3.org/2001/XMLSchema" xmlns: soap = "http://schemas.xmlsoap.org/soap/envelope/"> ';
Data = data + '<soap: Body> ';
Data = data + '<isNumner xmlns = "http://tempuri.org/myService/test"> ';
Data = data + '<str>' + value + '</str> ';
Data = data + '</isNumner> ';