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="http://ws.apache.org/ns/synapse" name="myProxy" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
   <target>
      <inSequence>
         <property name="uri.var.site" value="33" scope="default" type="STRING"/>
         <property xmlns:ns="http://org.apache.synapse/xsd" name="REST_URL_POSTFIX"
         expression="fn:concat('?site=', get-property('uri.var.site'), '&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')"/>
         </log>
         <property name="HTTP_METHOD" value="GET" scope="axis2" type="STRING"/>
         <send>
            <endpoint>
               <address uri=""http://******.net/accounts/info.json" format="rest"/>
            </endpoint>
         </send>
      </inSequence>
   </target>
   <description></description>
</proxy>

How to define HTTP Endpoint in WSO2 ESB 4.8.1
https://docs.wso2.com/display/ESB481/HTTP+Endpoint

REST_URL_POSTFIX https://docs.wso2.com/display/ESB481/HTTP+Transport+Properties#HTTPTransportProperties-REST_URL_POSTFIXREST_URL_POSTFIX


Monday, September 1, 2014

Create a patch using github pull request

This blog explains how to create a patch using github pull request

add ".patch" at the end of the pull request and execute the following command
curl https://github.com/<user>/<project>/pull/5.patch > 5.patch