Avatar of mathieu_cupryk
mathieu_cupryk
Flag 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>";
C#

Avatar of undefined
Last Comment
Gorkem Yuksel

8/22/2022 - Mon
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).
mathieu_cupryk

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

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23