Re: Retrieving values from HTTP POST

Tech-Archive recommends: Speed Up your PC by fixing your registry



Hi John,

What's the "objXMLDoc" in your code? Is it the MSXML's DOMDocument or the
..NET's
System.Xml.XmlDocument? Since we're not supported to use the COM msxml
component in .NET application, we should use the System.Xml.XmlDocument to
capture xml data. Here is the test code snippet I use in my ASP.NET web
page:

private void Page_Load(object sender, System.EventArgs e)
{
if(Request.ContentType == "text/xml")
{
XmlDocument doc = new XmlDocument();
doc.Load(Request.InputStream);

Response.Write(HttpUtility.HtmlEncode(doc.OuterXml));

Response.End();
}
}

Hope helps. Thanks,

Regards,

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: Mon, 15 Aug 2005 11:31:02 -0500
| From: John Smith <3rtwemte001@xxxxxxxxxxxxxx>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Subject: Re: Retrieving values from HTTP POST
| Date: Mon, 15 Aug 2005 11:31:02 -0500
| Message-ID: <cpg1g1hsmq6mgsslnmbsnvs7f6jd2mottt@xxxxxxx>
| References: <290521D6-6A0D-4233-AFEF-0F389A511BC3@xxxxxxxxxxxxx>
<1C82FCF5-85B7-48EE-AEBD-7942ED7AF3A3@xxxxxxxxxxxxx>
| 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-adqGpeoGmhDDgmTv1+mHE3QzJjsbKHGA0YanckV+sUpOZ2sdLt8OmviM9pfiRjuOXSUYdtFK
tZlNwD9!NO+LHmQaeH5ZCx83oN2WbvMdjnUEI1wWcGsNnz8ZktAlQKGvWxeegGuRNXSHpDaClBSg
lM/BzNpi!LF507AX/gtlkW6p07w==
| X-Complaints-To: abuse@xxxxxxxxxxx
| X-DMCA-Complaints-To: dmca@xxxxxxxxxxx
| 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!TK2MSFTFEED02.phx.gbl!tornado.fastwebnet.it!tiscali!ne
wsfeed1.ip.tiscali.net!news.maxwell.syr.edu!border1.nntp.dca.giganews.com!lo
cal01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for
-mail
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet:118025
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| 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"
| <SaravananKV@xxxxxxxxxxxxxxxxxxxxxxxxx> 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
|
|

.



Relevant Pages

  • RE: Illegal characters in path
    ... XmlDocument.load method is used for loading xml document from file. ... Howerver, if you want to load xml from string object, XmlDocument.LoadXml ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.xml)
  • RE: Query xml data in the table of sql server 2005
    ... string in the table and be able to get the xml string by select command. ... Microsoft Online Community Support ... a Microsoft Support Engineer within 2 business day is acceptable. ...
    (microsoft.public.sqlserver.programming)
  • RE: Embedd XML within XML - Possible ??
    ... it is not quite recommended that we store such ... If you do want to store complex XML data into the attribute field. ... Microsoft MSDN Online Support Lead ... ID Field and String Field ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: XML as a WebService parameter
    ... The param is of type "string" and the webservice is called via other .net ... passing in an XML string was acceptable. ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Retrieving values from HTTP POST
    ... Since we're not supported to use the COM msxml ... :capture xml data. ... Here is the test code snippet I use in my ASP.NET web ... :| error: convert from 'System.IO.Stream' to 'string'. ...
    (microsoft.public.dotnet.framework.aspnet)