XML发布到传统的ASP页面和检索页面上的数据后 [英] Post XML to classic asp page and retrieve the post data on page

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

问题描述

要后下code传统的ASP页面上的数据我使​​用

暗淡stringXML,HTT prequest,postResponsestringXML =< XML版本=1.0,编码=UTF-8><学校><类> 5℃/类>< /学校>中设置HTT prequest =的Server.CreateObject(MSXML2.ServerXMLHTTP.6.0)
HTT prequest.OpenPOST,HTTP://www.mywebpage/TestVBScript/RecieveRequest.asp,真
HTT prequest.SetRequestHeader内容类型,文本/ XML
HTT prequest.Send stringXML

现在我想要得到RecieveRequest.asp页面上的stringXML值。这样我可以处理我的XML,并发送回响应

任何帮助将AP preciated。在此先感谢


解决方案

 暗淡stringXML,HTT prequest,postResponsestringXML =< XML版本=1.0,编码=UTF-8><学校><类> 5℃/类>< /学校>中设置HTT prequest =的Server.CreateObject(MSXML2.ServerXMLHTTP.6.0)
HTT prequest.OpenPOST,HTTP://www.mywebpage/TestVBScript/RecieveRequest.asp,真
HTT prequest.SetRequestHeader内容类型,文本/ XML
HTT prequest.setRequestHeader的Content-Length,LEN(stringXML)
HTT prequest.Send stringXML如果HTT prequest.status = 200然后
    TextResponse = HTT prequest.responseText
    XMLResponse = HTT prequest.responseXML
    StreamResponse = HTT prequest.responseStream
其他
    '在这里处理缺失反应或其他错误
万一设置HTT prequest =什么

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

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天全站免登陆