tags:

views:

74

answers:

1

Hi, I am facing a n00b issue in .NET webservices. the WebMethod return type is encoding an already encoded string (already encoded by my xml writer).

Is there a way to turn of this off?

Example the prepared xml before the webmethod returns it <p> Hello World </p>

but the xml received by the client from the webmethod response &lt;p&gt; Hello World &lt;/P&gt;

the ampersand is getting encoded by the web method

I am using xmlwriter object to build the xml... has anyone a solution to this?

A: 

I'm guessing you're sending this to a webpage. What you're getting is the encoding to show the actual '<' characters on the screen and not the HTML reserved characters.

These '<' '>' are reserved characters in a HTML page for the HTML parsers to use. If you want to use them in your page, you use &lt (lesser than) &gt (greater than).

Try putting a '\' in front of each of your HTML reserved character. This is a guess, I'm not sure that it'll work.

Tony
Tony, thanks. the issue was my XMLWriter object was escaping the element strings instead of writing it raw. It is a n00b issue I faced.
bushman