Do I have to worry about escaping XML reserved characters before I return a DataContract object from

Posted by Brett Widmeier on Stack Overflow See other posts from Stack Overflow or by Brett Widmeier
Published on 2010-05-20T20:08:21Z Indexed on 2010/05/20 20:10 UTC
Read the original article Hit count: 224

Filed under:
|
|

Hi,

I am pretty inexperienced with WCF. I have a DataContract that implements the IExtensibleDataObject interface. Some of the members of this object are populated from freetext input and could contain XML reserved characters ('>', for example). I imagine that I get escaping of these characters for free with WCF, but I have been looking around and could not find anything commenting on this one way or another. Is this the case?

I have set my service to log the messages that it sends and receives for viewing in the Trace Viewer. Part of a message that my service returns looks like this:

<sInstructions>"></sInstructions>

Now, I have a couple questions about this.

1) Is it actually transmitting "&gt; and just showing it in a more readable form in the trace viewer?

2) If it is actually is transmitting ">, is this legal XML?

© Stack Overflow or respective owner

Related posts about wcf

Related posts about Xml