0
votes

I have a Mule 3 dw 1.0 application with a payload that is HTML which is produced by a parse template component (the mime type this produces is application/json). I want to use this unescaped HTML as a string value in a transform message component so I have something like:

%dw 1.0
%output application/json
---
{
   "body": payload
}

however, I get an exception at this stage due to < character not being valid. I have tried converting the payload to a string, converting the payload to a string prior to this transform message, converting the JSON to an object then to a string. None of which worked.

1
Please show the complete error (all lines) and the XML of the flow you got so far. Please use text instead of images. See meta.stackoverflow.com/questions/285551/… for more details on the reason.aled

1 Answers

0
votes

The solution was to create a new flow variable and importantly set its MIME type to text/html.