调用xmlhttp的send方法,如果传参数是XML-data,用VBS要怎样实现?
Dim httpset Actions=loadXMLDoc("C:\Documents and Settings\Administrator\桌面\自动化测试手机短信\testxml.xml")
Set http = CreateObject("Msxml2.XMLHTTP")
http.open "POST", "http://192.168.22.224:7205/test?wsdl", False
http.SetRequestHeader "Content-Type", "text/xml"
'http.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
http.send Actions.xml
WScript.Echo http.responseText
后台收到报文为空。
差不多如下:
Dim xmlHttp, aaa
Set xmlHttp = CreateObject("Microsoft.XMLHTTP")
url = urlCheck("http://192.168.22.224:7205/test?wsdl")
xmlHttp.open "post", "http://192.168.22.224:7205/test?wsdl", False
xmlHttp.setrequestheader "content-type", "application/x-www-form-urlencoded"
xmlHttp.send parameter
Do
Loop Until xmlHttp.readyState = 4
postHttp = xmlHttp.responseText
Set xmlHttp = Nothing
好久没搞了 你试试对不对 parameter这个参数是什么?我要转的是XML,主要是服务器收到参数错误 我现在的问题是传XML报文,后台服务器解释报文错误 楼主传的是XML吧?我估计可能是XML中的特殊字符导致,需要转义~
页:
[1]