Wednesday, December 10, 2014

Remove the payload and send POST request to backend via wso2 esb

There are situations where back-end does not need a payload for POST request. However in wso2 ESB has the payload that mediate before the back-end call. In order to drop the message payload you need to perform two tasks in the wso2 ESB.



Example is given below that demonstrate the use case. 

Tuesday, December 9, 2014

Bind WSO2 Mamanement Console to a certain IP Adress

There are lot of Security measures when deploy the WSO2 Server products. One of them is to restrict the accessibility of the server for certain IP addresses.

In WSO2 serves, it is possible to restrict via the the tomcat valve.

Edit
/repository/conf/tomcat/context.xml 


Add
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.0\.0\.1"/ >

How to delete the element in the array of json object in Java-script

Recently we had a very basic requirement to delete an key value pare in the json array using Javascript.


Input data

{"invideoPromotion":{"items":[{"id":{"type":"video","videoId":"11","websiteUrl":""},"timing":{"type":"ms","offsetMs":"2222"},"customMessage":"aa","promotedByContentOwner":"vanji"}]}}

Expected business logic

When type of id is video and websiteUrl is null; websiteUrl should be removed from the payload.

Output data

{"items":[{"id":{"type":"video","videoId":"11"},"timing":{"type":"ms","offsetMs":"2222"},"customMessage":"aa","promotedByContentOwner":"vanji"}]}}

In-order to do this you can use delete functionality of the json in javascript.

Example code