将 XML 发布到经典 asp 页面并检索页面上的发布数据 [英] Post XML to classic asp page and retrieve the post data on page

查看:16
本文介绍了将 XML 发布到经典 asp 页面并检索页面上的发布数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要在经典的 asp 页面上发布数据,我使用下面的代码

To post data on classic asp page i am using below code

Dim stringXML, httpRequest, postResponse

stringXML = "<?xml version=""1.0"" encoding=""UTF-8""?><School><Class>5</Class></School>"

Set httpRequest = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
httpRequest.Open "POST", "http://www.mywebpage/TestVBScript/RecieveRequest.asp", True
httpRequest.SetRequestHeader "Content-Type", "text/xml"
httpRequest.Send stringXML

现在我想在 RecieveRequest.asp 页面上获取 stringXML 值.这样我就可以处理我的 XML 并发送回响应

Now I want to get the stringXML value on RecieveRequest.asp page. So that i can process my XML and send back the response

任何帮助将不胜感激.提前致谢

Any help will be appreciated. Thanks in advance

推荐答案

Dim stringXML, httpRequest, postResponse

stringXML = "<?xml version=""1.0"" encoding=""UTF-8""?><School><Class>5</Class></School>"

Set httpRequest = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
httpRequest.Open "POST", "http://www.mywebpage/TestVBScript/RecieveRequest.asp", True
httpRequest.SetRequestHeader "Content-Type", "text/xml"
httpRequest.setRequestHeader "Content-Length", Len(stringXML)
httpRequest.Send stringXML

If httpRequest.status = 200 Then
    TextResponse = httpRequest.responseText
    XMLResponse = httpRequest.responseXML
    StreamResponse = httpRequest.responseStream
Else
    ' Handle missing response or other errors here
End If

Set httpRequest = Nothing

这篇关于将 XML 发布到经典 asp 页面并检索页面上的发布数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆