52,797
社区成员
发帖
与我相关
我的任务
分享
<html>
<head>
<title>SOAP Connection</title>
<script type="text/javascript">
function soap() {
var xmlhttp = new XMLHttpRequest();
xmlhttp.open('POST', 'https://xxxx.com:443/ws/xxxx', true);
// build SOAP request
var sr =
'<?xml version="1.0" encoding="utf-8"?>' +
'<soapenv:Envelope ' +
'xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" ' +
xxxxx +
'</soapenv:Body>' +
'</soapenv:Envelope>';
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
alert('done use firebug to see responce');
}
}
}
// Send the POST request
xmlhttp.setRequestHeader('Content-Type', 'text/xml');
xmlhttp.send(sr);
// send request
// ...CC
}
</script>
</head>
<body>
<form name="Demo" action="" method="post">
<div>
<input type="button" value="Soap" onclick="soap();" />
</div>
</form>
</body>
<html>
var xmlhttp =window.XMLHttpRequest? new XMLHttpRequest():new ActiveXObject("microsoft.xmlhttp");
你如何测试的?不要双击通过file浏览,要不也会出现跨域错误,要通过搭建服务器用http访问