A have a web method with input parameter type of string. But this parameter actually is not string but xml. The example of input is:
<![CDATA[<check>
<id>12354564</id>
<idMeaning>msisdn</idMeaning>
<amount>500</amount>
</check>]]>
Bellow is snipped form my code where i create the input and call the method
// create xml
var xml = new XElement("check",
new XElement("id", "41504823"),
new XElement("idMeaning", "msisdn"),
new XElement("amount", "500")
);
// add CDATA
var input = new XCData(xml.ToString());
// get client
var client = WSWrapper.GetClient();
// call method
client.DoCheck(input.ToString());
But then I have problems with encoding. If I check request over the wire I can see that xml has been encoded like
<![CDATA[<check>
<id>41504823</id>
<idMeaning>msisdn</idMeaning>
<amount>500</amount>
</check>]]>
How can I prevent this encoding?
No comments:
Post a Comment