有没有谁成功做出来xmlhttp发送soap的东西

Jearol 2009-05-14 03:05:05
我现在在做一个接口,需要发送一些数据给某服务器,手册上要求用soap,我用javascript创建xmlhttp,然后发送
可是到send的时候就报错“指定资源下载失败”,我也不清楚是服务器拒绝我的IP还是我的代码写的有问题
在网上找了些资料,我感觉如果是我的代码有问题,应该错在SOAPAction上边,可是手册里没有提到SOAPAction应该怎么写
手册里只给了数据格式,我很郁闷,希望有soap方面成功案例的朋友帮帮忙!!!谢谢了!!!

<script language="javascript">
function test(){
mydata=textfield.value;
datalength=mydata.length;
xml=new ActiveXObject("MSXML2.XMLHTTP");
xml.open("POST","https://webserver6.****.com/test/soap/isp2",false);
xml.setRequestHeader("Content-Type","text/xml; charset=utf-8");
//xml.setRequestHeader("HOST","118.102.27.62");
//xml.setRequestHeader("Content-Length",datalength);
//xml.setRequestHeader("SOAPAction","http://schemas.****.com/xdp/1.0/");
xml.send(mydata);
alert(xml.Status+"|"+xml.StatusText);
/*
xmldoc=new ActiveXObject("MSXML.DOMDocument");
xmldoc.load(xml.responseXML)
xmlStr=xmldoc.xml
alert(xmlStr);
*/
}
</script>

mydata=textfield.value;
这里就是手册上给的一个soap消息的格式,我放到一个文本域里了,alert出来没有问题,可就是发不出去,执行到xml.send(mydata);就提示“指定资源下载失败”
...全文
159 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
Jearol 2009-05-20
  • 打赏
  • 举报
回复
另外谢谢wtogether指点serverxmlhttp的用法
Jearol 2009-05-20
  • 打赏
  • 举报
回复
问题解决,是https证书的问题
谢谢各位大虾指点

xmlhttp是可以连接到https的
serverxmlhttp也可以,呵呵
wtogether 2009-05-19
  • 打赏
  • 举报
回复
https就不能用XMLHTTP,而要用ServerXMLHTTP,ServerXMLHTTP只能运行在服务器端,客户端不能运行,如果没有证书的话,得忽略SSL错误
http.Open之后,就要http.setOption 2, 13056
Jearol 2009-05-19
  • 打赏
  • 举报
回复
受教了,学习学习
先试试看
谢谢指点
Jearol 2009-05-15
  • 打赏
  • 举报
回复
应该不是跨域的问题,我在ASP里也做了,vbs脚本里也做了,都报一样的错误
而且换成其他地址xmlhttp是可以访问的

可能是https的问题吧,也可能是我代码的问题,真烦
cds27 2009-05-15
  • 打赏
  • 举报
回复
估计是https的问题吧,是否缺乏证书?
wtogether 2009-05-14
  • 打赏
  • 举报
回复
WEB上的html中的xmlhttp不能跨域
Jearol 2009-05-14
  • 打赏
  • 举报
回复
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<accessInfo xmlns="http://schemas.****.com/xdp/1.0/">
<username>abcde</username>
<password>xyz</password>
</accessInfo>
</soap:Header>
<soapenv:Body>
<activateSubscriptionRequest xmlns="http://schemas.****.com/xdp/1.0/">
<timestamp>2009-05-14T14:10:15Z</timestamp>
<transactionId>001</transactionId>
<unitCount>1</unitCount>
<subscriptionItem>
<subscriberID>1234567890987654321</subscriberID>
<startDate>2009-05-15</startDate>
<endDate>2009-06-15</endDate>
<licenseCount>2</licenseCount>
<productID>KKKK</productID>
</subscriptionItem>
</activateSubscriptionRequest>
</soapenv:Body>
</soapenv:Envelope>

这是soap消息的内容,手册上给的例子稍微修改的

“****”内容不便公布,抱歉了

8,906

社区成员

发帖
与我相关
我的任务
社区描述
XML/XSL相关问题讨论专区
社区管理员
  • XML/XSL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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