XML string being escaped/decoded when wrapped in CDATA and used in a web serivce
Hi all I’m using a third party webservice, and one of the attributes i need to send in the body is a string of XML wrapped in CDATA. Here’s what the value looks like in the debugger, after my sub microflow creates the string. Or this: <QuestionData> <isMetricSystem>false</isMetricSystem> <Height1>5</Height1> <Height2>5</Height2> <Weight1>8</Weight1> <Weight2>8</Weight1> </QuestionData> The problem is, when it gets passed through the Web Service, it’s getting automatically escaped/partially decoded, so this is what the actual request looks like… Note the < tags being replaced with <. This is making the web service unusable, as this API isn’t able to handle that string they’re actually receiving. Does anyone know of any workarounds to this issue, to prevent this automatic escape/decode? It’s really frustrating that Mendix seems to do this without any settings to allow otherwise.
Our workaround to fix this was to build the XML by hand, pass it to custom Java action that POSTs the data to the webservice, and returns an XML string that can be imported using an Import Mapping.
It’s not ideal, but works until we can find a better solution.