Creating a client application for BPEL processes and human tasks (Java web services)
A client application sends requests to and receives responses
from the Business Process Choreographer web services APIs. By using
a web service proxy to manage communications and helper classes to
format complex data types, a client application can invoke web service
methods as if they were local functions.
Before you begin
About this task
Topic scope: This topic applies
to the following Business Process Choreographer web services interfaces:
You can develop client applications using any web services-compatible
development tool, for example IBM® Rational® Application
Developer. You can build any type of web services application to call
the web services APIs. - HTTP transport layer
- JMS transport layer
Procedure
- Create a new client application project.
- Generate the web service proxy.
- Code your client application.
- Build the project.
- Run the client application.
Examples for the HTTP and JMS transport layers
The following examples show how to use the Business Flow Manager web service API for the supported transport layers. The examples differ in how the web service proxy is generated.
- HTTP transport layer
- The following example shows how to use the Business Flow Manager
web service API for the HTTP transport layer.
try { // create bfm proxy BFMJAXWSPortType bfm = new BFMJAXWSService().getBFMJAXWSPort(); // call getProcessTemplate ProcessTemplateType ptt = bfm.getProcessTemplate("MY_PROCESS_TEMPLATE_NAME"); // handle return value System.out.println("Process template '" + ptt.getName() + "' found, details following:"); System.out.println("Execution mode: " + ptt.getExecutionMode()); System.out.println("Schema version: " + ptt.getSchemaVersion()); } catch (Exception e) { if ( e instanceof ProcessFaultMsg ) { ProcessFaultMsg pfm = (ProcessFaultMsg) e; List<FaultStackType> list = ( pfm.getFaultInfo() ).getFaultStack(); FaultStackType fault = list.get( 0 ); System.out.println( "ProcessFaultMessage: " + fault.getMessage() ); } else { e.printStackTrace( System.out ); } } - JMS transport layer
- The following example shows how to use the Business Flow Manager
web service API for the JMS transport layer.
try { // create bfm proxy BFMJAXWSPortType bfm = new BFMJMSService().getBFMJMSPort(); // call getProcessTemplate ProcessTemplateType ptt = bfm.getProcessTemplate("MY_PROCESS_TEMPLATE_NAME"); // handle return value System.out.println("Process template '" + ptt.getName() + "' found, details following:"); System.out.println("Execution mode: " + ptt.getExecutionMode()); System.out.println("Schema version: " + ptt.getSchemaVersion()); } catch (Exception e) { if ( e instanceof ProcessFaultMsg ) { ProcessFaultMsg pfm = (ProcessFaultMsg) e; List<FaultStackType> list = ( pfm.getFaultInfo() ).getFaultStack(); FaultStackType fault = list.get( 0 ); System.out.println( "ProcessFaultMessage: " + fault.getMessage() ); } else { e.printStackTrace( System.out ); } }
This topic only applies to BAW, and is located in the BAW repository. Last updated on 2025-03-13 12:15