asp构造soap调用.net发布的web服务(没有代理验证)
来源:互联网 发布:晋中教育网网络教研 编辑:程序博客网 时间:2024/05/23 22:47
- <%
- url = "http://localhost/webservice/Service.asmx"
- SoapRequest="<?xml version=""1.0"" encoding=""utf-8""?>"& _
- "<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""> "& _
- "<soap12:Header> "& _
- "</soap12:Header> "& _
- "<soap12:Body>"& _
- "<loginService xmlns=""http://tempuri.org/""> "& _
- "<SYSID>"111"</SYSID> "& _
- "</loginService> "& _
- "</soap12:Body>"& _
- "</soap12:Envelope>"
- Set xmlhttp = server.CreateObject("Msxml2.XMLHTTP")
- xmlhttp.Open "POST",url,false
- xmlhttp.setRequestHeader "Content-Type", "application/soap+xml; charset=utf-8"
- xmlhttp.setRequestHeader "Content-Length",LEN(SoapRequest)
- xmlhttp.setRequestHeader "SOAPAction", "http://tempuri.org/relationService"
- xmlhttp.Send(SoapRequest)
- Response.Write xmlhttp.responsetext
- Set xmlhttp = Nothing
- %>