In this section we describe the procedure for starting a PXE server and deploying some example systems that incorporate BPEL processes. While PXE is designed primarily for embedded deployment into J2EE environments, it can run "out-of-the-box" as a stand-alone server started from the command-line. The stand-alone server uses popular open source components to supply needed functionality:
- the Hibernate
ORM layer and HypersonicSQL
database for persistence;
- the Jetty
servlet container for inbound HTTP communications;
- the Jakarta Commons HTTPClient
for outbound HTTP communications;
- and ObjectWeb JOTM
for transaction management.
In the interest of simplicity we will limit our description to the stand-alone server (in its default configuration), and describe tasks that can be performed on the command-line (either Windows or UNIX will work, however we will stick to UNIX notation).
The stand-alone PXE server can be started using the pxe shell script found in the PXE ./bin directory.
To start the PXE server, make sure that the JAVA_HOME environment variable is set, change into the PXE installation directory, and execute bin/pxe:
The above will result in the display of various log messages on the console. For the curious, more extensive logging can be found in the logs/pxe.log file in the current (PXE installation) directory. After a few seconds the PXE server will be ready.
Once the PXE server is up and running, we are ready to deploy PXE systems. PXE systems are units of deployment comprising of one or more interconnected PXE services. PXE systems take the form of PXE system archives, (a.k.a. SAR files) which consist of a system deployment descriptor (an XML file named pxe-system.xml) describing the system and its services, as well as any number of resources that may be required by the constituent services.
To deploy a PXE system typically requires that one create and deploy a PXE system archive. This requires compiling the BPEL process (typically with the bpelc command), writing a PXE system deployment descriptor (pxe-system.xml), creating a resource repository (with the rradd command), creating a system archive (with the sarcreate command), and deploying said system archive (with the pxe-deploy command).
The stand-alone PXE server provides a short-cut that automates the above procedure, by allowing us to deploy systems simply by placing a JAR containing all the relevant (unprocessed) artifacts in a special auto-deployment directory (./etc/deploy). We will adopt this procedure as it involves significantly fewer steps. Example systems that may be deployed using this technique are found in sub-directories of the ./examples directory. To deploy, simply copy the JAR file into the auto-deployment directory; for example:
If the above should produce any errors on the stand-alone server's console, simply edit the offending file, re-JAR, and re-copy to the deployment directory:
Included with the installation are several example PXE systems featuring BPEL processes. They are found in the sub-directories of the ./examples directory. To deploy any of these systems, simply copy the JAR file within the specific example directory into the ./etc/deploy directory. If the system is already deployed, the system will automatically undeploy and redeploy with the new system.
Test SOAP messages are included with the examples to test the deployed process. A SOAP client utility is also included to invoke the process using "SOAP-over-HTTP".
The HelloWorld example consists of a simple BPEL process that receives an input message with a string part, appends "World" to the string and replies with the result.
To deploy the Hello World example:
To send a SOAP "Hello" message to the process, invoke the following command (the result should contain the string "HelloWorld"):
To see that the system is deployed (without necessarily looking at the logs or console output), the pxe-status command can be used:
The GeoIP example sends an IP address as content over HTTP-SOAP to a BPEL processes which in turns relays the request to a remote Web Service. Once the response is collected, the client is returned the geographic location of the IP address. Because this example involves the invocation of a remote Web Service, you may need to relax your firewall.
To deploy the GeoIP example:
To send a SOAP request to the process, invoke the following command:
Note that the pxe-status command will show both the HelloWorld and GeoIp systems deployed at this point:
Undeploying the HelloWorld system can be accomplished with the pxe-undeploy command:
The Asynchronous Process example features a fairly complex process that demonstrates multiple invokes, asynchronous callbacks, and correlations. Please refer to the BPEL process definition for details.
To deploy the Asynchronous Process example:
To send a SOAP request to the process, invoke the following command:
Included with the distribution is a set of bpel scripts to exercize the various activities and features of the bpel engine. The wsdl, bpel, xml schemas, and other configuration files can be found in the examples/spexercizer.
To run all 72 tests:
To run a specific test (or set of tests), include the name(s) of the bpel file(s) to run: