Note that there are some explanatory texts on larger screens.

plurals
  1. POCDATA in payload factory in WSO2 ESB
    text
    copied!<p>I am trying to write a sequence in ESB and populate my payload data by using payload factory as i stated below example.</p> <pre><code> &lt;payloadFactory&gt; &lt;format&gt; &lt;p:echoInt xmlns:p="http://echo.services.core.carbon.wso2.org"&gt; &lt;in xmlns=""&gt;$1&lt;/in&gt; &lt;/p:echoInt&gt; &lt;/format&gt; &lt;args&gt; &lt;arg xmlns:ns="http://org.apache.synapse/xsd" expression="an-xml-formatted-string"/&gt; &lt;/args&gt; &lt;/payloadFactory&gt; &lt;send&gt; &lt;endpoint&gt; &lt;address uri="http://noon101:8280/services/echo" format="soap11"/&gt; &lt;/endpoint&gt; &lt;/send&gt; </code></pre> <p>Because my string is formatted as xml when i send this payload to the service, the service tries to parse my xml parameter and (i do not understand what is the exact reason) my web service method is not called. in this <a href="http://pomzung.wordpress.com/2011/02/12/treating-xml-input-parameters-of-a-soap-request-as-a-string/" rel="nofollow">link</a> it says that if i use cdata than the parser will not parse my xml formatted string and there will be no problem. </p> <p>But the problem is Payload Factory mediator do not accept Cdata in its content. When i write the configuration of Payload Factory as indicated below, it deletes CDATA keywords from it and problem consists.</p> <pre><code> &lt;payloadFactory&gt; &lt;format&gt; &lt;p:echoInt xmlns:p="http://echo.services.core.carbon.wso2.org"&gt; &lt;in xmlns=""&gt; &lt;![CDATA[ $1 ]]&gt; &lt;/in&gt; &lt;/p:echoInt&gt; &lt;/format&gt; &lt;args&gt; &lt;arg xmlns:ns="http://org.apache.synapse/xsd" expression="an-xml-formatted-string"/&gt; &lt;/args&gt; &lt;/payloadFactory&gt; </code></pre> <p>What would be the solution to this problem? Any other mediator to set payload or any workaround will be appreciated.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload