asp-->soap
下面是一个 SOAP 请求和响应示例。所显示的占位符需要由实际值替换。
POST /webserver/WS_BIG5/qq.asmx HTTP/1.1
Host: webserver.wzilin.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/Mobile "
<?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://schemas.xmlsoap.org/soap/envelope/ ">
<soap:Body>
<Mobile xmlns= "http://tempuri.org/ ">
<Mobile> string </Mobile>
</Mobile>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?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://schemas.xmlsoap.org/soap/envelope/ ">
<soap:Body>
<MobileResponse xmlns= "http://tempuri.org/ ">
<MobileResult> string </MobileResult>
</MobileResponse>
</soap:Body>
</soap:Envelope>
-------------------------------
strxml = " <?xml version= '1.0 ' encoding= 'utf-8 '?> "
strxml = strxml & " <soap:Envelope xmlns:xsi= 'http://www.w3.org/2001/XMLSchema-instance ' xmlns:xsd= 'http://www.w3.org/2001/XMLSchema ' xmlns:soap= 'http://schemas.xmlsoap.org/soap/envelope/ '> "
strxml = strxml & " <soap:Body> "
strxml = strxml & " <Mobile xmlns= 'http://webserver.wzilin.com/webserver/WS_BIG5/qq.asmx '> "
strxml = strxml & " <Mobile> 13900000000 </Mobile> "
strxml = strxml & " </Mobile> "
strxml = strxml & " </soap:Body> "
strxml = strxml & " </soap:Envelope> "
Set h = Server.CreateObject( "Microsoft.XMLHTTP ")
h.open "POST ", "http://webserver.wzilin.com/webserver/WS_BIG5/qq.asmx ", False
h.setRequestHeader "Host ", "webserver.wzilin.com "
h.setRequestHeader "Content-Type ", "text/xml; charset=utf-8 "
h.setRequestHeader "Content-Length ",LEN(strxml)
h.setRequestHeader "SOAPAction ", "http://webserver.wzilin.com/webserver/WS_BIG5/qq.asmx/Mobile "
h.send (strxml)
If h.Status = 200 Then
Set objXML = server.CreateObject( "Microsoft.XMLDOM ")
objXML.load(h.responseXML)
xmlstr=objXML.childNodes(1).Text
Set objXML=nothing
response.write xmlstr
Else
Response.Write h.Status & ":其他 <br> "
Response.Write h.StatusText
End if
为什么总是h.Status=500?
[解决办法]
顶,看不出来什么问题
[解决办法]
你的内容都是固定的,当然值就一样了
[解决办法]
500是内部服务器错误.
[解决办法]
看看objXML.ResponseText中有没有详细错误?
[解决办法]
555555555555555555
小声问一句;什么是soap?
[解决办法]
soap?香皂?
怎么会这样?
[解决办法]
SOAP - 简单对象处理协议(Simple Object Access Protocol) - 是当前XML开发的热点。不过我也不太懂.