Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML post decoding problem

Status
Not open for further replies.

romh

Programmer
Jan 3, 2003
297
US
Hi, I am able to finally receive an xml post into my asp.net 1.1 c# application. An external server (another language) posts the XML it using an HTTP post. The directions also say that they use form encoding. Anyway, I am having lots of trouble decoding the xml that i am receiving.
I have tried

Encoding unicode = Encoding.UTF8;
Byte[] unicodeBytes = unicode.GetBytes(param);
string content1 = unicode.GetString(unicodeBytes);
char[] asciiChars = new char[unicode.GetCharCount(unicodeBytes, 0, unicodeBytes.Length)];

unicode.GetChars(unicodeBytes, 0, unicodeBytes.Length, asciiChars, 0);
string content = new string(asciiChars);


Can anybody tell me a better way? What is form encoding?
thanks alot.
 
Code:
using System.IO;
using System.Xml;

Code:
System.IO.StreamReader sr = new System.IO.StreamReader(Request.InputStream);
string xml = sr.ReadToEnd();
XmlDocument xDoc = new XmlDocument();
xDoc.LoadXml(xml);

Try that - I'm usualy wrong but if you get enough monkeys in a room you get shakespear.



Yet another unchecked rambling brought to you by:
Oddball
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top