有点懵逼的webserver访问
‘定义webserver地址
Dim postUrl As String = ""
‘定义webserver所需xml字符串参数
Dim xmlRequest As String = ""
‘获取webserver返回信息
Dim responseText As String = ""
‘定义传输字符编码
Dim URLEncode As System.Text.Encoding = System.Text.Encoding.GetEncoding("utf-8")
‘将xml字符串参数转化为byte数组
Dim postdata() As System.Byte = URLEncode.GetBytes(xmlRequest)
‘获取xml字符串参数传输长度
Dim xmlRequestLength As Integer = postdata.Length
‘定义XMLHttp访问webserver,记得Imports MSXML2(Microsoft XML, v6.0)
Dim oXMLHttp As New XMLHTTP60()
oXMLHttp.open("Post", postUrl, False)
oXMLHttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8")
oXMLHttp.setRequestHeader("Content-length", xmlRequestLength)
oXMLHttp.setRequestHeader("Accept-Language", "zh-CN")
oXMLHttp.setRequestHeader("SOAPAction", http://tempuri.org/"+webserver方法的目标方法+")
oXMLHttp.setRequestHeader("Host", "webserver服务器所在IP")
oXMLHttp.send(xmlRequest)
responseText = oXMLHttp.responseText