Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to convert the JSON in WSO2 ESB
    primarykey
    data
    text
    <p>I am trying to pass my JSON as a object to a WSO2 ESB. I am getting JSON like this:</p> <pre><code>'{FIELDNAME":"NAME",FIELDVALUE:"KISHORE"}' </code></pre> <p>This JSON I need to pass my ESB as a dynamic column. But Its accepting like JSON <code>{"NAME":"KISHORE"}</code>. How can I convert from above JSON to below one in WSO2 ESB. If I get above one I am unable to pass to proxy. If I get below one I will pass like this <code>(//name/child::text())</code> then I will get value as "KISHORE" I was tried with ENRICH mediator but its not working.</p> <pre><code>&lt;proxy xmlns="http://ws.apache.org/ns/synapse" name="test_dynamic" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"&gt; &lt;target&gt; &lt;inSequence&gt; &lt;enrich&gt; &lt;source type="body" clone="true"/&gt; &lt;target type="property" property="RM"/&gt; &lt;/enrich&gt; &lt;property name="RM" expression="//fieldname/child::text()" scope="default" type="STRING"/&gt; &lt;log level="custom"&gt; &lt;property name="r_no" expression="get-property('R_no')"/&gt; &lt;property name="r_value" expression="get-property('R_value')"/&gt; &lt;property name="emp_d" expression="get-property('emp')"/&gt; &lt;property name="RM" expression="get-property('RM')"/&gt; &lt;/log&gt; &lt;log level="full"/&gt; &lt;/inSequence&gt; &lt;/target&gt; &lt;description&gt;&lt;/description&gt; &lt;/proxy&gt; </code></pre> <p>ANS: request, Envelope:</p> <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt; &lt;soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"&gt; &lt;soapenv:Body&gt;&lt;fieldname&gt;e_no&lt;/fieldname&gt;&lt;fieldvalue&gt;5&lt;/fieldvalue&gt;&lt;/soapenv:Body&gt; &lt;/soapenv:Envelope&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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