views:

21

answers:

1

Can some one tell me why am I getting the following data in return of WCF service request? I want the formatted XML so that I can parse it.

<?xml version="1.0" encoding="utf-8"?><string>&lt;DocumentElement&gt;&#xD;
  &lt;UT&gt;&#xD;
    &lt;UserFirstName&gt;z&lt;/UserFirstName&gt;&#xD;
    &lt;UserLastName&gt;z&lt;/UserLastName&gt;&#xD;
    &lt;LastLoginDate&gt;2010-08-18T14:46:42.623-07:00&lt;/LastLoginDate&gt;&#xD;

    &lt;UserID&gt;1245&lt;/UserID&gt;&#xD;
    &lt;ImageURL&gt;~/Images/UserPhotos/shaddow.gif&lt;/ImageURL&gt;&#xD;
    &lt;USERGUID&gt;151c272d-7b8c-4546-a901-b3672f3d0802&lt;/USERGUID&gt;&#xD;
  &lt;/UT&gt;&#xD;

  &lt;UT&gt;&#xD;
    &lt;UserFirstName&gt;y&lt;/UserFirstName&gt;&#xD;
    &lt;UserLastName&gt;y&lt;/UserLastName&gt;&#xD;
    &lt;LastLoginDate&gt;2010-08-18T14:46:20.67-07:00&lt;/LastLoginDate&gt;&#xD;

    &lt;UserID&gt;1247&lt;/UserID&gt;&#xD;
    &lt;ImageURL&gt;~/Images/UserPhotos/shaddow.gif&lt;/ImageURL&gt;&#xD;
    &lt;USERGUID&gt;8bb17541-1cd8-4e9d-9045-2ef80fa691e3&lt;/USERGUID&gt;&#xD;
  &lt;/UT&gt;&#xD;

&lt;/DocumentElement&gt;</string>
+1  A: 

Your service returns string. XML passed in a string is always encoded. If you want to get unencoded XML you have to return objects which will be serialized to XML (DataContracts) or you can try to return XmlElement / XElement.

Ladislav Mrnka
hey thanks for your help. It really worked.
Umair Ashraf