Thursday, November 24, 2016

How to overwrite the Character Set Encoding in WSO2 ESB 5.0.0

Use the below property to change the character set encoding. Here the scope must be axis2.
<property name="CHARACTER_SET_ENCODING" value="UTF-8" scope="axis2" type="STRING"/>
Sample API used for this kind of scenario is as below:
<api xmlns="http://ws.apache.org/ns/synapse" name="character-encode" context="/test">
   <resource methods="POST">
      <inSequence>
         <log level="custom">
            <property name="STATUS:" value="-------------IN INVOKED-------------------------"/>
         </log>         
         <send>
            <endpoint>
               <http method="POST" uri-template="http://localhost:8089/test/get"/>
            </endpoint>
         </send>
      </inSequence>
      <outSequence>
         <log level="custom">
            <property name="STATUS:" value="-------------OUT INVOKED-------------------------"/>
         </log>
         <property name="CHARACTER_SET_ENCODING" value="UTF-8" scope="axis2" type="STRING"/>
         <property name="messageType" value="application/json" scope="axis2" type="STRING"/>
         <send/>
      </outSequence>
   </resource>
</api>

No comments:

Post a Comment