Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note

WSO2 ESB uses Rhino engine to execute JavaScripts. Rhino engine converts the script to a method inside a Java class. TherebyTherefore, when processing large JSON data volumes, the code length must be less than 65536 characters, since the Script mediator converts the payload into a Java object. However, you can use the following alternative options to process large JSON data volumes.

  • Achieve the same functionality via a Class mediator.
  • If the original message consists of repetitive sections, you can use the Iterate mediator to generate a relatively small payload using those repetitive sections which . This will then allow you to use the Script mediator.

...

Code Block
XML
XML
<script key="string" language="stringjs" [function="script-function-name"]/>

...

Code Block
XML
XML
<script language="string">js"><![CDATA[...script source code...<script]]><script/>

...

UI Configuration

Script Type

...

Code Block
XML
XML
<script language="js">mc><![CDATA[mc.getPayloadXML()..symbol != "IBM";<script]]><script/>

The above configuration is an example of an inline mediator using JavaScript/E4X which returns false if the SOAP message body contains an element named symbol, which has a value of IBM.

...