0

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 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.