soap request的参数无法发送

angelataoy 2004-07-15 10:00:45
在asp用xmlhttp发送soap request如下
SoapRequest = "<?xml version="&CHR(34)&"1.0"&CHR(34)&" encoding="&CHR(34)&"utf-8"&CHR(34)&"?>"& _
"<soap:Envelope xmlns:xsi="&CHR(34)&"http://www.w3.org/2001/XMLSchema-instance"&CHR(34)&" "& _
"xmlns:xsd="&CHR(34)&"http://www.w3.org/2001/XMLSchema"&CHR(34)&" "& _
"xmlns:soap="&CHR(34)&"http://schemas.xmlsoap.org/soap/envelope/"&CHR(34)&">"& _
"<soap:Body>"& _
"<helloWorld xmlns="&CHR(34)&"http://hello/"&CHR(34)&">"& _
"<param0 xsi:type="&CHR(34)&"xsd:string"&CHR(34)&">Tom</param0>"& _
"</depositCard>"& _
"</soap:Body>"& _
"</soap:Envelope>"


url ="http://***.***.***.***/hellows/helloService?methodname=helloWorld"


Set xmlDOC =server.CreateObject("MSXML.DOMDocument")
xmlDOC.loadXML(SoapRequest)


Set xmlhttp = server.CreateObject("Msxml2.XMLHTTP")
xmlhttp.Open "POST",url,false

xmlhttp.setRequestHeader "Content-Type", "text/xml;charset=utf-8"
xmlhttp.setRequestHeader "SOAPAction", "urn:deposit-Deposit/depositCard"
xmlhttp.setRequestHeader "Content-Length",LEN(SoapRequest)
xmlhttp.Send(xmlDOC)

xmlhttp status 返回200 但是xmlhttp response 报错,告知param0的参数为空,也就是body中的值并未传出,请问是何原因?是网络故障吗?请问如何设超时和重试次数?
谢谢大侠


...全文
407 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
HuangQQ 2004-12-22
  • 打赏
  • 举报
回复
学习!
朋友别哭 2004-07-18
  • 打赏
  • 举报
回复
up
angelataoy 2004-07-15
  • 打赏
  • 举报
回复
soaprequest 应为:
SoapRequest = "<?xml version="&CHR(34)&"1.0"&CHR(34)&" encoding="&CHR(34)&"utf-8"&CHR(34)&"?>"& _
"<soap:Envelope xmlns:xsi="&CHR(34)&"http://www.w3.org/2001/XMLSchema-instance"&CHR(34)&" "& _
"xmlns:xsd="&CHR(34)&"http://www.w3.org/2001/XMLSchema"&CHR(34)&" "& _
"xmlns:soap="&CHR(34)&"http://schemas.xmlsoap.org/soap/envelope/"&CHR(34)&">"& _
"<soap:Body>"& _
"<helloWorld xmlns="&CHR(34)&"http://hello/"&CHR(34)&">"& _
"<param0 xsi:type="&CHR(34)&"xsd:string"&CHR(34)&">Tom</param0>"& _
"</helloWorld>"& _
"</soap:Body>"& _
"</soap:Envelope>"

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧