Thursday, December 15, 2011

Create and Deploy a Data Service using WSO2 Carbon Studio 1.0.14

I assume you have downloaded latest version of WSO2 Carbon Studio and ready with a Eclipse instance which has latest Carbon Studio installed. 

Now we are going to create a data service with WSO2 Carbon Studio and deploy it to WSO2 DSS within Eclipse. 

Following are the steps that you need to follow.
Create a C-App project (make sure, you are in JavaEE perspective)
  • File -> New -> Project -> Carbon Application Project

Give a name to the project (eg: myApplication) and click Finish

Right click on the C-App and go to New -> Data Service

You can create a data service in different ways
  • Create a new data service
  • Import existing data service descriptor file from the file system
  • Import existing data service descriptor file from a registry instance

Select the option you want to create the data service and click Finish
Once you create your data service, it will open in graphical tree editor by default.

But you can open it using xml editor as well. 
  • right click on the file (Dataservice1.dbs) and go to Open With -> XML Editor

When you open the data services descriptor file in the xml editor, you will have content assist as well. 

Once you done with editing, save the configuration.

Delpoy data service in to WSO2 Data Services Server
  • Add WSO2 DSS in to carbon studio
    • Go to Servers view (if you can’t see it, go to Window -> Show View -> Servers)
    • Right click on the Servers view, New -> Server

In the New Server wizard page, select WSO2 Carbon 3.2 based server under WSO2 catagory. 
You can change the Server Name if you want. Then click Next

Specify the <carbon-home> where you extract your DSS server

Then you will get the page where you can specify the ports which your server is going to run. It will display the default ports initially.

In the next page, you can specify the Carbon Projects that you need to deploy in to the server you are going to add. Click on the C-App project and select Add and Click Finish

Start the Server
  • Then start the server by right click on the server instance and select Start

Now you can see, server is being started.

Once the Server has been started, you will see, it will start deploying the C-App project

After successful deployment, you can go to the management console and check whether your data service has been deployed 

You can do changes to you descriptor file from Eclipse and by redeploying, it will add the modified changes to the server

In WSO2 Carbon Studio next release, we have integrate source view with the design view. And this source view will be fully integrated with content assist.