Hi RHPT,
Have you got any progress on this issue or does the suggestion in my
previous messages helps. If there are anything else we can help, please
feel free to pos there. Thanks,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| X-Tomcat-ID: 47208013
| References: <
[email protected]>
<
[email protected]>
<
[email protected]>
<
[email protected]>
<
[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: (e-mail address removed) (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Fri, 19 Aug 2005 02:24:34 GMT
| Subject: Re: Retrieving values from HTTP POST
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| Message-ID: <
[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Lines: 97
| Path: TK2MSFTNGXA01.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:119027
| NNTP-Posting-Host: tomcatimport2.phx.gbl 10.201.218.182
|
| Hi RHPT,
|
| You means the XML content in your request are coming from the clientside
| input in a TextBox? If so, I don't think we can directly use the
| Request.InputStream to load the Xml content since the whole http
message's
| contentType is event not pure XML. We can load XmlDocument directly from
| the Request.InputStream only if the pure request message is "text/xml"
| contentType. For example, we can send XML content to a remote page
through
| the following code:
|
| ==============
| static void Post_XML()
| {
| string url = "
http://remoteserver/app/remotepage.aspx";
|
| HttpWebRequest webreq = WebRequest.Create(url) as HttpWebRequest;
|
| webreq.Method = "POST";
| webreq.ContentType = "text/xml";
|
|
| XmlDocument doc = new XmlDocument();
| doc.LoadXml(
| @"<?xml version='1.0' ?>
| <root>
| <items>
| <item id='1'>item1</item>
| <item id='2'>item2</item>
| <item id='3'>item3</item>
| <item id='4'>item4</item>
| </items>
| </root>
| "
| );
|
| StreamWriter sw = new StreamWriter(webreq.GetRequestStream(),
| System.Text.Encoding.UTF8);
| sw.Write(doc.OuterXml);
| sw.Close();
|
| HttpWebResponse webrep = webreq.GetResponse() as HttpWebResponse;
| StreamReader sr = new
| StreamReader(webrep.GetResponseStream(),System.Text.Encoding.UTF8);
|
| Console.WriteLine(sr.ReadToEnd());
| sr.Close();
| webrep.Close();
|
| }
| ===========================
|
| Thanks,
|
| Steven Cheng
| Microsoft Online Support
|
| Get Secure!
www.microsoft.com/security
| (This posting is provided "AS IS", with no warranties, and confers no
| rights.)
| --------------------
| | NNTP-Posting-Date: Thu, 18 Aug 2005 20:35:01 -0500
| | From: RHPT <
[email protected]>
| | Newsgroups: microsoft.public.dotnet.framework.aspnet
| | Subject: Re: Retrieving values from HTTP POST
| | Date: Thu, 18 Aug 2005 20:34:57 -0500
| | Message-ID: <
[email protected]>
| | References: <
[email protected]>
| <
[email protected]>
| <
[email protected]>
| <
[email protected]>
| | X-Newsreader: Forte Agent 2.0/32.652
| | MIME-Version: 1.0
| | Content-Type: text/plain; charset=us-ascii
| | Content-Transfer-Encoding: 7bit
| | Lines: 21
| | NNTP-Posting-Host: 69.137.71.225
| | X-Trace:
|
sv3-tqkcQ2XW4EE9xw18jiJjXuANveHVgbfoc05N5egU8S4IaI6IrVyNbV/YEaLlsoyLoC+VJvUw
|
0DGWkFd!QIWeCmsrkJS0gql7mj+eeXKYNjlQyKqWTL1VrYRwVeYo45DLITxDL3JenJbf86cv9ddq
| MSJcW+yb!NbDf2F9l68qFqzNhrw==
| | X-Complaints-To: (e-mail address removed)
| | X-DMCA-Complaints-To: (e-mail address removed)
| | X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
| | X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your
| complaint properly
| | X-Postfilter: 1.3.32
| | Path:
|
TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
|
ne.de!border2.nntp.dca.giganews.com!nntp.giganews.com!border1.nntp.dca.gigan
|
ews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POST
| ED!not-for-mail
| | Xref: TK2MSFTNGXA01.phx.gbl
| microsoft.public.dotnet.framework.aspnet:119021
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
| |
| | Here's something strange:
| |
| | On default.aspx, I have a textbox that I fill with the following XML
| | string and then submit:
| |
| |
|
<myFields><txt_name>adsf</txt_name><gender_buttons>Male</gender_buttons><bir
| thday>2005-08-17</birthday><spam_me>true</spam_me></myFields>
| |
| | On my code behind page, I have the following code:
| |
| | XmlDocument doc = new XmlDocument();
| | doc.LoadXml(Request.InputStream.ToString());
| | doc.Save("C:\\Inetpub\\wwwroot\\RX2\\test.xml");
| |
| | When I debug into the code, Request.InputStream.ToString() returns
| | "System.Web.HttpInputStream".
| |
| | I've debugged intot he code, and looked at the Request object. Nowhere
| | does it have the XML.
| |
| |
| |
| |
|
|