Loading ...

WCF: There was an error deserializing the object of type xxx. End element 'xxx' from namespace '' expected. Found element 'xx' from namespace ''. | CodeAsp.Net

WCF: There was an error deserializing the object of type xxx. End element 'xxx' from namespace '' expected. Found element 'xx' from namespace ''.

 /5
0 (0votes)

While posting html data in xml string in WCF application I was getting the following error:
There was an error deserializing the object of type xxx. End element 'xxx' from namespace '' expected. Found element 'xx' from namespace ''.

Reason:
XML parser was treating my html string in xml tag as special tags itself.

Solution:
The solution was to esacpe html string to get parsed from XML parser and that can be done via wrapping the html string inside the xml tag by CDATA 

Your xml tag should look like this:

<MyTag><![CDATA[Your HTML]]></MyTag>

Comments (no comments yet)

Top Posts