We have a standard web service client created in VS 2012 with .NET 4.5 where the service reference is created through “Add service reference” in VS.
The service has an element defined like:
<xsd:element minOccurs="0" maxOccurs="1" name="Data" type="xsd:string" />
This element is supposed to contain CDATA with XML like:
<![CDATA[<data>somedata</data>]]>
Since this is a string, the element is serialized and sent to the service like
<![CDATA[<data>somedata</data>]] >
The problem is that the web service don’t understand < and >. Since the web service is managed by a government agency this will not change anytime soon. Is there an easy way to tell the client not to escape < and >?
Update: Simplified version of how we send the request (C#):
Form form = new Form();
form.FormData = "<![CDATA[<message>data</message>]]>";
WebServiceClient client = new WebServiceClient();
var respons = client.SubmitForm(form);