Sunday, December 13, 2009

Blackberry/OracleBPEL

This week i got an oppurtunity to call a BPEL webservice from a blackberry.

Blackberry developement community recommends to use ksoap2 a lightweight soap engine to call a webservice.


I Hope the notes below will help people who are new to blackberry development and BPEL

Simple Steps to get the app running on your blackberry.

a. Install Eclipse 3.4 and JDE plugin(It has JDE 4.5 component pack)

b. Start MDS

How to Start MDS?

MDS for JDE 4.5 need a JRE 1.6 .So please make sure it is installed correctly.

go to command prompt ,navigate to the below path

C:\Program Files\Eclipse2\plugins\net.rim.eide.componentpack4.5.0_4.5.0.16\components\MDS

run.bat

To Verify MDS.

in the simulator ,click the browser and verify if you are able to see a web page( http://www.google.com)

c. Add the preverified ksoap2 jar to your class path.

d. use the below code to call a Oralce bpel webservice.



try{

/*paste your end point URL from BPELConsole in the argument of HTTP Transport constructor.*/


HttpTransport ht = new HttpTransport("http://hostname:port/orabpel/domain/serviceEndPoint/1.0");

/*I am using Oracle BPEL 10.1.3.3.1 which uses soap 1.1 bindings.Please make sure about you soap version and select the version

for eg:

soap binding 1.1 choose SoapEnvelope.VER11

soap binding 1.2 choose SoapEnvelope.VER12*/


SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

SoapObject request = new SoapObject("schemaName","elementName");


//send parameters to your BPEL Process. request.addProperty("input","890");
envelope.setOutputSoapObject(request);

//the first param in the belowline of code is your operation name on the bpel webservice.

ht.call("soapAction",envelope);

Note:soapAction is the operation name in your WSDL.

//in case if you call a Synchronous webservice

Object soapIn = envelope.getResponse();

System.exit(0);

}catch(Exception e){
System.out.println("inside catch"+e.toString());
}

}
};


e. Right Click the Project . Select Generate Alx.

f. Plug your blackberry through USB. Start the Desktop manager.

G. Since this simple project is not using any api which requires signing we can deploy it without the RIM keys.

Please let me know if you have any questions.
Thanks
Prem