网上找的代码,测试通过,留作备份。相应data请自行更换为自己的格式
function RequestByPost(value ) {
var data;
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 + '<GetLog xmlns="http://tempuri.org/">';
data = data + '<IDNo>' + value + '</IDNo>';
data = data + '</GetLog>';
data = data + '</soap:Body>';
data = data + '</soap:Envelope>';
//var xmlhttp = new XMLHttpRequest();
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
var URL = "http://测试地址/IDlog.asmx";
xmlhttp.Open("POST", URL, false);
xmlhttp.SetRequestHeader("Content-Type", "text/xml; charset=utf-8");
xmlhttp.SetRequestHeader("SOAPAction", "http://tempuri.org/GetLog");
xmlhttp.Send(data);
$('#test').append(xmlhttp.responseText);
};