Mar 6, 2009

The lost (collaxa) BPEL-tutorials: 102.Invoking... RMI

This tutorials shows, how to invoke a BPEL process inside Oracle's PM using RMI.
To run this tutorial please deploy the CrediRatingService like shown in this posting.

Then enter the directory $ORACLE_HOME/bpel/samples/tutorials/102.InvokingProcesses/rmi. First take a look at the sample code (com/otn/samples/RMIClient.java):

Locator locator = new Locator("default","bpel",props);
IDeliveryService deliveryService = (IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME );
// construct the normalized message and send to collaxa server
NormalizedMessage nm = new NormalizedMessage( );
nm.addPart("payload", xml );
NormalizedMessage res = deliveryService.request("CreditRatingService", "process", nm);
Map payload = res.getPayload();


and the properties inside context.properties:
orabpel.platform=ias_10g
java.naming.factory.initial=com.evermind.server.rmi.RMIInitialContextFactory
java.naming.provider.url=opmn:ormi://mysoaserver:6003:oc4j_soa/orabpel
java.naming.security.principal=oc4jadmin
java.naming.security.credentials=SECRET

and that's all.
To run this example set BPEL_HOME to $ORACLE_HOME/bpel and type
$ORACLE_HOME/ant/bin/ant javac
and
$ORACLE_HOME/ant/bin/ant run

The result should look like this:

oracle@mysoaserver:tutorials/102.InvokingProcesses/rmi >/opt/oracle/product/10.1.3.1/OracleAS_1/ant/bin/ant run
Buildfile: build.xml

run:
[copy] Copying 1 file to $ORACLE_HOME/bpel/samples/tutorials/102.InvokingProcesses/rmi/classes
[echo] JRMI Client on ias_10g app-server
[java] ssn is 123-12-1234
[java] {java.naming.provider.url=opmn:ormi://gipsun173.gip.local:6003:oc4j_soa/orabpel, java.naming.factory.initial=com.evermind.server.rmi.RMIInitialContextFactory, orabpel.platform=ias_10g, java.naming.security.principal=oc4jadmin, java.naming.security.credentials=SECRET}
[java] BPELProcess CreditRatingService executed!<br>
[java] Credit Rating is <rating xmlns="http://services.otn.com">560</rating>

BUILD SUCCESSFUL
Total time: 12 seconds


You can find all bpel tutorials on this blog via this link.

No comments:

Post a Comment