Sunday, December 6, 2015

How to Develop A Proxy Service in WSO2 Dev Studio & Deploy in WSO2 ESB.


Prerequisites


1. WSO2 Developer studio .
2. WSO2 Enterprise Service Bus (ESB) .
In this blog post I am describing you how to develop a proxy service in WSO2 Developer Studio and deploy in WSO2 ESB.
First you need to create an “ESB Config Project” in WSO2 Dev Studio.
Open Developer Studio Dashboard. Select "ESB Config Project" as shown below and create a project.


The structure of the project is as shown below.

Now create a proxy service. Right click on “proxy-services” and select “create new proxy service.” from the drop down menu.
Here I used the following example proxy service .
 
  
Then you need to create a CAR file. To do that you need to create a “Composite Application Project”.
Right click on the ESB Config Project which was created early. Then select
New → Project → Composite Application Project.
 Right Click on the “Composite Application Project” which you created. Then select “Export Composite Application Project” from the drop down menu.
Give a location to save the CAR file.
Then go to that file location and you will be able to see the CAR file .zip folder.

How to Deploy the CAR file in WSO2 ESB?

Go to ESB Management Console and Select “Main” tag. Then go to “Carbon Application” section and click on “Add”.


Then you can see the following console. Click on “Browse” and add the created CAR file and click on “Upload”.






  The CAR file will be listed under the Carbon Application list as shown below.

Click on the CAR file which is in the Carbon Application List. Then you will receive the console as shown below.To run the proxy click on “Try This Service” .