I am trying to write a sequence to an ESB and populate my payload data using the factory payload, as I said below.
<payloadFactory> <format> <p:echoInt xmlns:p="http://echo.services.core.carbon.wso2.org"> <in xmlns="">$1</in> </p:echoInt> </format> <args> <arg xmlns:ns="http://org.apache.synapse/xsd" expression="an-xml-formatted-string"/> </args> </payloadFactory> <send> <endpoint> <address uri="http://noon101:8280/services/echo" format="soap11"/> </endpoint> </send>
Since my string is formatted as xml, when I send this payload to the service, the service tries to parse my xml parameter and (I donβt understand what the reason is), my web service method is not called. this link says that if I use cdata, the parser will not parse my formatted xml string and there will be no problems.
But the problem is that the Payload factory intermediary does not accept Cdata in its content. When I write the factory payload configuration as follows, it removes the CDATA keywords from it and the problem is.
<payloadFactory> <format> <p:echoInt xmlns:p="http://echo.services.core.carbon.wso2.org"> <in xmlns=""> <![CDATA[ $1 ]]> </in> </p:echoInt> </format> <args> <arg xmlns:ns="http://org.apache.synapse/xsd" expression="an-xml-formatted-string"/> </args> </payloadFactory>
What will be the solution to this problem? Any other intermediary to establish a payload or any workaround will be appreciated.
Alper source share