问题描述
webservice服务端MyWork这个方法有参数,webservice发布到IIS下8080端口,在前台页面soap拼写的xml文件,及xmlhttprequest请求,但是webservice服务端后台获取不到前台页面xml中person这个参数的值,麻烦各位帮忙看下,谢谢了。varxml=""+"<?xmlversion="1.0"encoding="utf-8"?>"+"<soap:Envelopexmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">"+"<soap:Body>"+"<MyWorkxmlns="http://tzcrmwebservice.com/"/>"+"<person>111</person>"+"</soap:Body>"+"</soap:Envelope>";varXMLHttpRequest=newActiveXObject("Msxml2.XMLHTTP");XMLHttpRequest.Open("post","http://localhost:8080/service1.asmx",false);XMLHttpRequest.setRequestHeader("SOAPAction","http://tzcrmwebservice.com/MyWork");XMLHttpRequest.setRequestHeader("Content-Type","text/xml;charset=utf-8");//xmlHttpRequest.setRequestHeader("Content-Length",xml.length);XMLHttpRequest.send(xml);varResult=XMLHttpRequest.responseXML;varresustr=Result.childNodes[1].text;
解决方案
解决方案二:
这里有个源码地址,希望对你有帮助http://www.51aspx.com/code/AlmightyManageSys