Nov 25, 2010

Develop a BPEL project using Eclipse and Apache ODE.

To do this thing you need to install these software.
 Apache ODE on Apache Tomcat server and Eclipse IDE with BPEL designer plugin. 
First you should download and install tomcat web server.

Then you can download the ODE war file from this link;

Unzip this file and put that into the webapps folder in the tomcat.
Then you must restart the tomcat server.

After that you must install the Eclipse IDE (Eclipse IDE for Java EE Developers). You can download it from this website.

The run the Eclipse IDE and go to,
Help -> Install new software
Then in the window, add this URL to the space called "work with":

Then it will provide some plugins and you should install those things to your Eclipse IDE.

Now you need to setup the IED to communicate with the ODE. TO do that you must go to,
File -> New -> Other
and select "Server " in the server directory.
This will pop-up a new window,in that you must select,
apache -> Ode v1.x Server

This will ask some details according to your Apache-Tomcat and JDK setting of your machine.  Mainly you must give the path to the ODE field as;

Then try to start the server from the IDE, first stop it from console if the server is running. 

Now you can try to design a project. First  go to, New -> Projects;
And there you should select BPEL -> BPEL Project
Then in the wizard you must select "Apache Ode v1.x Runtime" and in the configurations section select "BPEL2.0 Facets".

Then this will open a project folder, right click on that and select new -> other and in the wizard select BPEL -> New BPEL Process file.

Now you can see  some file like <something>.bpel, double click on it. It will open a graphical flow chart kind of a thing. In the right side  of that you can see some tools which can be use to design the process. Try these tools, but I will explain how to get a output from an input String. To do that thing;
You must insert "Assign" part in between the input and output. Then go to its properties by right clicking on it.
Then go to details and add a new. it  will show two fields to fill. In the first select input and click on "input:string", on the other select output and do the same. Then perss the save button. At this time it will ask some thing  like "Variable output doesn't have initializer. Should it be generated? ", In this, press "Yes" 
This step will create a file like <something>.wsdl, double click on it. It will view a network kind of a thing. You must edit the URL in the <project_name>Port to;
And also you must select the protocol as "SOAP".

Save the project and right click on the main project folder. Go to  New -> Other and select "Apache ODE deployment Descriptor". This will generate a XML file called deploy.xml. You must double click and open it. In that select inbound Interface -> Associated Port and give the "<project_name>Port" in the drop down menu. If it does not excise, you  must restart the Eclipse IDE and all file names and project names must be equal. If there is no error you can try to run it.
To do that you must go to the Server, right click on it and select add/remove project. In the wizard you must add the project to the server and run it. If the server in not running, run it from the IDE by clicking the run button while the server is selected. 

Now  you can go to the project explore, select and right click on the  <project_name>.wsdl and go to;
web services -> Test with web service explore.
That action will view a web browser kind of an environment. In that you can see your project file, click on that and it will view a file call "process". Double click on that. In the next window you can insert a value and press go, you will see the same output from the below frame.

Our process was get a string and return it. So this done that thing. We can do more thing  by changing the process flow with the graphical aid. It is the amin advantage of this thing and this is a web based system, therefore it's more easy to manage and use.

1 comment:

  1. When I test my web service with web service explore
    the following error appear:

    ERROR [INVOKE] org.apache.ode.bpel.common.FaultException: {}uninitializedPartnerRole

    I don't know how to solve this error?


Your comments are always welcome ...