Hi All,
I am returning a xml string which is showing in below format.
XML1:
<CustomerOrder><Version>1.0</Version><Id /><MessageCreateDate>2010-08-09T18:06:19.561+05:30</MessageCreateDate><MessageCreateBy>OCI</MessageCreateBy><MessageGUID>2bf8c699-2118-49bc-8574-ca54f4d3d14f</MessageGUID><MessagePurpose>ProcessSalesOrderEBM</MessagePurpose><CustomerContext><CustomerNumber>350590463</CustomerNumber><BusinessUnitId>4545</BusinessUnitId><Buid>350</Buid><IBU>350</IBU><Country>KR</Country><Language
But i want in formatted xml like as shown below
XML2:
<pre lang="xml">- <CustomerOrder>
<Version>1.0</Version>
<Id /> <MessageCreateDate>2010-08-09T18:06:19.561+05:30</MessageCreateDate>
<MessageCreateBy>OCI</MessageCreateBy>
<MessageGUID>2bf8c699-2118-49bc-8574-ca54f4d3d14f</MessageGUID>
<MessagePurpose>ProcessSalesOrderEBM</MessagePurpose>
- <CustomerContext>
<CustomerNumber>350590463</CustomerNumber>
<BusinessUnitId>4545</BusinessUnitId>
<Buid>350</Buid>
please find the below code which i am using
StringBuilder sb = new StringBuilder();
byte[] buf = new byte[8192];
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(OFS_DataURL + in_message_id);
request.Credentials = CredentialCache.DefaultCredentials;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
using (Stream resStream = response.GetResponseStream())
{
string tempString = null;
int count = 0;
do
{
count = resStream.Read(buf, 0, buf.Length);
if (count != 0)
{
tempString = Encoding.UTF8.GetString(buf, 0,count);
sb.Append(tempString);
}
}
while (count > 0);
resStream.Close(); }
Response = Serialize<String>(sb.ToString());
Response = DeSerialize<String>(Response);
return Response;
so it is returning xml as a string as shown in XML1 but i wnat xml to be return in XML2 foramt.
can anybody please help how to do this?