views:

65

answers:

1

We have a webservice created in WCF and presenting itself as a basicHttpBinding. One of the parameters is a string which takes an xml string. Looking at the soap the client generates to send to the webservice, the xml is encoded, with all < and > swapped into &lt; and &gt;. My question is, is this all that is encoded, or has the parameter been run through HtmlEncode so that other entities would be swapped also?

The reason I ask is we are submitting with our client to a 3rd party webservice now and they would like to know the details on what is encoded.

+1  A: 

It is not HMTMEncoded.

But to make it a valid string in XML the following characters must be escaped:

 &  =>  &amp;amp; 
 <   =>  &amp;lt;
 >   =>  &amp;gt; 
 "  =>  &amp;quot;
 '  =>  &amp;apos;

", ' and & must not neccessarily be escaped (however they should be), as their meaning depends on their use inside the xml string.

See the spec for the exact rules.

Obalix
from the sample I have its definately < and > however " seems to have been untouched
dnolan
Obalix