Returning UTF-8 from a web service

Posted by Marco Shaw on Stack Overflow See other posts from Stack Overflow or by Marco Shaw
Published on 2010-12-24T01:38:34Z Indexed on 2010/12/24 1:54 UTC
Read the original article Hit count: 571

Filed under:
|

Previous: Returning info from a Web Service

I thought the previous answer made 100% sense, and I though I was out of the woods, but it still fails.

An app I'm working with still seems to think what is being returned from the web service is ASCII encoded. Debugging it shows:

<Envelope><Body><ReturnOneResponse><ReturnOneResult>&lt;xml version="1.0" encoding="UTF-8"&gt;&lt;Entry&gt;&lt;Symbol&gt;PACR&lt;/Symbol&gt;&lt;Company&gt;Pacer International, Inc.&lt;/Company&gt;&lt;MarketCap&gt;$229.0M&lt;/MarketCap&gt;&lt;PE&gt;18.7&lt;/PE&gt;&lt;Price&gt;6.56&lt;/Price&gt;&lt;Change&gt;0.42&lt;/Change&gt;&lt;PctChange&gt;6.84%&lt;/PctChange&gt;&lt;YTDChange&gt;107.59%&lt;/YTDChange&gt;&lt;/Entry&gt;</ReturnOneResult></ReturnOneResponse></Body></Envelope>

So everything being returned from the web service seems to be changed into ASCII, and seems to refuse to read as UTF-8.

Since my previous code in the above link, I also changed my string invocation: string value = @"";

Still, that didn't help.

Any other ideas?

© Stack Overflow or respective owner

Related posts about Xml

Related posts about web-services