================================
Building Apache ODE from Sources
================================

If you downloaded the source distribution of ODE you can safely ignore the first paragraph. It's only useful if you want the bleeding edge of ODE.

Getting the source code
-----------------------

First you will have to make sure that you have [Subversion|http://svn.tigris.org]. If you don't know what Subversion is or don't  have it installed, check [here|http://svnbook.red-bean.com]. Once installed run:

svn checkout http://svn.apache.org/repos/asf/ode/trunk ode

For more information or if you have any problem with Subversion (like being behind a proxy or a firewall) check our Source Code documentation (http://ode.apache.org/source-code.html).

Building With Buildr
--------------------

Buildr requires a Ruby interpreter. If you're running Linux or Mac OS you most probably already have Ruby installed on your machine. For Winows user Ruby installation is very simple. You will need the following:

 * Ruby 1.8.x with RubyGems 0.9 or later. For Windows users using the Ruby One-Click Installer is the easiest (http://rubyforge.org/projects/rubyinstaller/). For Linux or Mac OS users, a Ruby interpreter is usually preinstalled. Just make sure to have the ruby-dev package (mkmf is needed for RJB).

 * Buildr. Install it by running 'gem install buildr -v 1.3.5'. A proper JAVA_HOME environment variable must be set. Make sure to choose either win32 or ruby platforms (don't choose java for Antwrap, that's JRuby).

Building is then pretty simple. Open a command in the source root directory and run:

buildr _1.3.5_ package

To try the test cases bundled with ODE:

buildr _1.3.5_ test

It just works! For more information about buildr see http://buildr.apache.org/.

Running in Tomcat (WAR deployment)
----------------------------------

You should find the full distribution in the distro-axis2/target directory. Unzip it somewhere on your disk, everything needed is inside.

Get the WAR file in the distribution root directory (should be named apache-ode-war-x.x.zip), rename it to *ode.war* and copy this file to Tomcat's webapp directory. You should get a blank page under http://localhost:8080/ode. The Ode WAR includes its own embedded database (Derby - http://db.apache.org/derby) so you don't have to worry about configuring any external database for now.

Testing a Tomcat Deployment
---------------------------

Copy the content of examples directory in the distribution (the 3 sub-directories) to _tomcat/webapps/ode/WEB-INF/processes_, this will automatically deploy the 3 example processes. Use the sendsoap command located in the distribution _bin_ directory to send test messages. The messages to run each of the 3 examples are provided in their respective directory (testRequest.soap). For each example type:

bin/sendsoap http://localhost:8080/ode/processes/helloWorld examples/HelloWorld2/testRequest.soap

or

bin/sendsoap.sh http://localhost:8080/ode/processes/helloWorld examples/HelloWorld2/testRequest.soap

The URLs should be updated according to the address defined in the WSDL file for the process service.

If you want to use an IDE to explore the ODE sources or debug ODE executables, Eclipse .project and .classpath files are present in all the modules; simply choose File|Import from the Eclipse menu, and select the root ODE directory. You may also use Maven to generate project files for other IDEs. See the Maven documentation for details.

Running in ServiceMix (JBI deployment)
--------------------------------------

You should find the full distribution in the distro-jbi/target directory. Unzip it somewhere on your disk, everything needed is inside.

Get the zip containing ODE's service engine in the distribution root directory (should be named apache-ode-jbi-x.x.zip) and copy it in the install directory of ServiceMix 3.1. Most process deployments will also require HTTP binding so you should also copy the servicemix-shared and servicemix-http zip files from its components directory to its install directory. Start ServiceMix by going into its root directory and type:

bin/servicemix

The server should start properly.

Testing a ServiceMix Deployment
-------------------------------

JBI examples come with ant scripts to build the service assemblies and test them. It's just a 3 step process:

1. Go to the example directory and run ant (no need to specify a task, the default one will work).
2. Copy the zip service assembly created in the build subdirectory to the deploy directory of ServiceMix.
3. Run 'ant test' from the example directory.
