Link to home
Create AccountLog in
Avatar of mathieu_cupryk
mathieu_cuprykFlag for Canada

asked on

Convert string to xml file.

I need to convert the following string to xml file:
 string strData = "<resellerAsyncResponse xmlns=\"http://www.verizonwireless.com/oas\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.verizonwireless.com/oas http://localhost:8080/schema/reseller.xsd\">" + "<messageHeader>" + "<versionNumber>001</versionNumber>" + "<vendorId>KOREWIRELESS</vendorId>" + "<channelId>B2B</channelId>" + "<channelType>RSS</channelType>" + "<requestType>ORDER</requestType>" + "<orderType>MNTMLND</orderType>" + "<referenceNumber>KOREWIRELESS_262152</referenceNumber>" + "<returnURL>http://10.253.118.230:80/receive.aspx</returnURL>" + "<resend>0</resend>" + "</messageHeader>" + "<orderResponse>" + "<mdn>2013964615</mdn>" + "<min>2013964615</min>" + "<statusCode>S0000</statusCode>" + "<errorCode>0</errorCode>" + "<errorDescription>Success</errorDescription>" + "</orderResponse>" + "</resellerAsyncResponse>";
Avatar of redflair
redflair

Seems you already have proper XML data. I would either dump it to an XML file using TextWriter or Load and Save it using XMLDocument (to avoid parsing error later due to improper format, if anticipated).
Avatar of mathieu_cupryk

ASKER

The problem is with this:
 byte[] data = client.UploadFile(url, "POST", fileName);
           
ASKER CERTIFIED SOLUTION
Avatar of Gorkem Yuksel
Gorkem Yuksel
Flag of Canada image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account