Bite my bytes

What I learn by day I blog at night - A blog from Microsoft Consultant working from Ljubljana, Slovenia

  Home :: Contact :: Syndication  
  999 Posts :: 7691 Comments :: 235 Trackbacks


Most popular posts
in last 180 days


My Projects



Copyright © by David Vidmar
Contact me!
LinkedIn Profile

If you receive a simple string (not in DataSet or Array or as a member of any other object) as a return of a WebMethod and that string contains an Enviroment.NewLine ("\r\n") the \r character somehow gets lost.

I tested only with a a simple WebService with a use of a proxy generated with VS.NET 2003. I guess it must be some kind of a SAOP or XML feature. Anyone care to explain?

My problem is solved with a simple replace:

string sResult wsSampleWebSerice();
sResult sResult.Replace("\n", Environment.NewLine);

[Update: my code HTML formatter replace "\n" with "\\n". Fixed now.]

Posted on Sunday, April 03, 2005 9:29 PM | Filed under: Developement |


# re: WebServices eat \r in \r\n 4/3/2005 11:09 PM Andrej
A simple Xml serialization thing, I'd say...

# re: WebServices eat \r in \r\n 4/3/2005 11:21 PM Andrej
... and you can find some further explanation here:

# re: WebServices eat \r in \r\n 4/4/2005 11:40 AM David
Tnx, Andrej. I was confident someone else will find it. :)

Comments have been closed on this topic.