Thursday, September 11, 2014

Define HTTP endpoint in WSO2 ESB 4.6.0

WSO2 ESB 4.6.0 does not support the HTTP endpoint feature as 4.7.0. But we can send a HTTP GET request with query parameters using the property REST_URL_POSTFIX in ESB 4.6.0.

Below proxy configuration in 4.6.0 will send a GET request with the query parameters defined in REST_URL_POSTFIX.

<proxy xmlns="" name="myProxy" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
         <property name="" value="33" scope="default" type="STRING"/>
         <property xmlns:ns="http://org.apache.synapse/xsd" name="REST_URL_POSTFIX"
         expression="fn:concat('?site=', get-property(''), '&cm_user_pw=' ,12345 , '&account=' , 'accout' , '&key=' , 'testKey' , '&q=' ,123)" scope="axis2" type="STRING"/>
         <log level="custom">
            <property name="url" expression="get-property('axis2','REST_URL_POSTFIX')"/>
         <property name="HTTP_METHOD" value="GET" scope="axis2" type="STRING"/>
               <address uri=""http://******.net/accounts/info.json" format="rest"/>

How to define HTTP Endpoint in WSO2 ESB 4.8.1


No comments: