首页 新闻 会员 周边

一个ASP调用webService 的问题

0
悬赏园豆:20 [已关闭问题] 关闭于 2010-03-19 15:59

下面是完整代码,就是得不到结果。
<%  
url = "HTTP://API.510769.COM/Service.asmx

 
SoapRequest="<?xml version=""1.0"" encoding=""utf-8""?>"&_
"<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://www.w3.org/2003/05/soap-envelope"">"&_
"  <soap:Body>"&_
"    <AandB xmlns=""HTTP://API.510769.COM"">"&_
"      <a>1</a>"&_
"      <b>2</b>"&_
"    </AandB>"&_
"  </soap:Body>"&_
"</soap:Envelope>"

 
Set xmlDOC =Server.CreateObject("MSXML.DOMDocument")  
Set xmlhttp = server.CreateObject("Msxml2.XMLHTTP")  
xmlhttp.Open "POST",url,False
xmlhttp.setRequestHeader "Content-Type", "text/xml;charset=utf-8"
xmlhttp.setRequestHeader "Content-Length",LEN(SoapRequest)
xmlhttp.setRequestHeader "SOAPAction", "HTTP://API.510769.COM/AandB"
xmlhttp.Send(SoapRequest)


bOK = xmlDOC.load(xmlhttp.responseXML)  
xmlStr = xmlDOC.xml  
Response.Write(bOK&xmlStr)  
 
Set xmlhttp = Nothing 
Set xmlDOC = Nothing 
 
%> 

张三封的主页 张三封 | 初学一级 | 园豆:121
提问于:2010-03-19 15:38
< >
分享
所有回答(1)
0

xmlhttp.setRequestHeader "SOAPAction", "HTTP://API.510769.COM/AandB"这里出毛病了吧!

这个http://api.510769.com/Service.asmx才是你的实际路径吧!

西越泽 | 园豆:10775 (专家六级) | 2010-03-19 15:51
找到问题了
支持(0) 反对(0) 张三封 | 园豆:121 (初学一级) | 2010-03-19 15:59
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册