从HTTP POST检索值 [英] Retrieving values from HTTP POST

查看:75
本文介绍了从HTTP POST检索值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用.NET捕获InfoPath表单发布的XML,但是我无法弄清楚如何捕获InfoPath发回的XML流

形式。使用Classic ASP,我可以创建一个MSXML对象,然后使用简单的objXML.Load(Request)加载XML

。这会给我一个XML流,然后我就可以操作它了。


然而,使用System.Xml,这是不可能的 - 不是我有的发现,

无论如何。 InfoPath文档简单地声明InfoPath将HTTP POST请求的主体中的XML数据发送到指定的URL,然后将

表单发送到页面。

但是如何访问那数据?任何帮助将不胜感激。

I am wanting to capture the XML posted by an InfoPath form with .NET, but I
cannot figure out how to capture the XML stream sent back by the InfoPath
form. With Classic ASP, I could just create an MSXML object then load the XML
with a simple objXML.Load(Request). This would give me the XML stream, which
I could then manipulate.

However, using System.Xml, this is not possible - not that I have found,
anyway. The InfoPath documentation simply states that "InfoPath sends the
form as XML data in the body of an HTTP POST request to the specified URL".
But how do I access that data? Any help would be greatly appreciated.

推荐答案

" =?Utf-8?B?UkhQVA ==?=" < RH ** @ online.nospam>写在

新闻:29 ********************************** @ microsof t .com:
"=?Utf-8?B?UkhQVA==?=" <RH**@online.nospam> wrote in
news:29**********************************@microsof t.com:
但是,使用System.Xml,这是不可能的 - 无论如何我找不到。 InfoPath文档简单地声明InfoPath
将表单作为XML数据发送到HTTP POST请求的正文中
指定的URL。但是我如何访问这些数据?非常感谢任何帮助。
However, using System.Xml, this is not possible - not that I have
found, anyway. The InfoPath documentation simply states that "InfoPath
sends the form as XML data in the body of an HTTP POST request to the
specified URL". But how do I access that data? Any help would be
greatly appreciated.




检查身体...这是一个隐藏的表格字段吗?


如果是,您可以使用Request.Form(FormName)来检索

XML的值。


-

Lucas Tam(RE********@rogers.com)

请删除删除来自回复时的电子邮件地址。
http://成员。 ebay.com/aboutme/coolspot18/





在ASP.Net中,您可以使用System.XML.XmlDocument对象用于处理

xml而不是MSXML。


代码片段用于从请求中加载xml:


System.XML.XmlDocument xDoc = new System.XML.XmlDocument();

xDoc.Load(Request.InputStream);

/ /现在,操作xDoc

-

Saravanan KV

" RHPT"写道:
Hi,

In ASP.Net, you can use the System.XML.XmlDocument object for working on the
xml instead of the MSXML.

code snippet for loading the xml from the request:

System.XML.XmlDocument xDoc = new System.XML.XmlDocument();
xDoc.Load(Request.InputStream);
//Now, manupulate the xDoc

--
Saravanan K V
"RHPT" wrote:
我想用.NET捕获InfoPath表单发布的XML,但是我无法弄清楚如何捕获InfoPath发回的XML流
表格。使用Classic ASP,我可以创建一个MSXML对象,然后使用简单的objXML.Load(Request)加载XML
。这将为我提供XML流,然后我可以操作。

然而,使用System.Xml,这是不可能的 - 不是我找到的,
无论如何。 InfoPath文档只是声明InfoPath将表单中的XML数据作为HTTP数据发送到指定的URL。
但是如何访问该数据?任何帮助将不胜感激。
I am wanting to capture the XML posted by an InfoPath form with .NET, but I
cannot figure out how to capture the XML stream sent back by the InfoPath
form. With Classic ASP, I could just create an MSXML object then load the XML
with a simple objXML.Load(Request). This would give me the XML stream, which
I could then manipulate.

However, using System.Xml, this is not possible - not that I have found,
anyway. The InfoPath documentation simply states that "InfoPath sends the
form as XML data in the body of an HTTP POST request to the specified URL".
But how do I access that data? Any help would be greatly appreciated.



运行代码objXMLDoc.Load(Request.InputStream)返回

错误:从''System.IO.Stream''转换为''string''。我添加了

''.ToString()'',但这只会导致文本字符串

''System.Web.HttpInputStream'',而不是实际的XML。


On Sun,2005年8月14日07:15:03 -0700,Saravanan K V

< Sa *** ******@discussions.microsoft.com>写道:






:在ASP.Net中,你可以使用System.XML.XmlDocument对象用于处理

:xml而不是MSXML。



:用于从请求中加载xml的代码片段:



:System.XML.XmlDocument xDoc = new System.XML.XmlDocument();

:xDoc.Load(Request.InputStream);

://现在,操作xDoc

Running the code objXMLDoc.Load(Request.InputStream) returns the
error: convert from ''System.IO.Stream'' to ''string''. I''ve added
''.ToString()'', but that results in just the text string
''System.Web.HttpInputStream'', and not the actual XML.

On Sun, 14 Aug 2005 07:15:03 -0700, "Saravanan K V"
<Sa*********@discussions.microsoft.com> wrote:

:Hi,
:
:In ASP.Net, you can use the System.XML.XmlDocument object for working on the
:xml instead of the MSXML.
:
:code snippet for loading the xml from the request:
:
:System.XML.XmlDocument xDoc = new System.XML.XmlDocument();
:xDoc.Load(Request.InputStream);
://Now, manupulate the xDoc


这篇关于从HTTP POST检索值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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