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

Tuesday, November 17, 2009

J2EE Authentication and Authorization - Oracle Application Server 10.1.3
Hello All,

Thought this may help Developers who are trying to secure their apps

As we all know Authentication and Authorization could be a Filebased or From a Database or From LDAP Directory.

File Based Security:

The File which is used for Authentication purposes in 10.13 server is system-jazn-data.xml

This file will be located in

/ORACLE_HOME/j2ee/oc4j_instance/config.


Create Users from EM Console

a. Login to EM Console of App Server

b. click on oc4j-instance

c.click on Administration--> security Provider --> Click Create (make sure the Realm is Jazn.com)

Embedded Oc4j

Please refer the below link to create users and Roles on a embedded oc4j

http://download.oracle.com/docs/cd/B32110_01/webcenter.1013/b31072/tt_appendix_a.htm

The file which gets updated with this information will be located in

\jdev_home\jdev\system\oracle.j2ee.10.1.3.42.70\embedded-oc4j\config\system-jazn-data.xml


OID --> you could use a 3rd party LDAP or OID (if you have Portal)

Assumption: This Container is configured to use single Sign on.

a. Create Group(Login as Administrator --go to edit mode-->click on Builder-->click on Administer)

b.Assign Users to the group created.

Configure this group in web.xml file.

Note:

You cant use the 'AUTHENTICATED_USERS' group which is the Default Group in OID.

So , you should create a new group and assign users if you want to use in your App.

Reason is explained in Metalink Note:ID 376644.1


Thanks
Prem

Friday, November 6, 2009

RIA with Oracle Portal/BPEL

Hello,

I was looking ways to use our Existing infrastructure effectively, for the RI application development.

The Below Link Helped me to Start planning my Development.

http://www.jamesward.com/blog/2006/11/02/flex-your-oracle-portal/

We always develop an Application using Blazeds or Flex with remote service or WebService and deploy it to 10.1.3 container (as Blazeds works only on 1.5) and integrate it as a partner application with portal.

This works Fine ..However Instead of Calling the Flex app as an external App ,i integrated it within a portlet and deployed to Oracle Portal 10.1.4

Development Steps.

a. Developed a Bpel WebService and deployed it to a Bpel Container .

b. I used soap-UI to Test the Service.

For eg:http://hostname:port/orabpel/domain/DivIdentifierService/1.0DivIdentifierService?wsdl


c.Developed the Flex App And consumed the BPEL Web-Service.(show the data returned by the Bpel-webservice in a DataGrid)

Compiled it

d.Created a page group called swf( you can name it what ever..)

e.Used a webDav Client(Oracle Drive) to upload the .swf file to the PageGroup

Path of my swf File.
/portal/page/portal/PageGroupName/DisplayName/FlexBpel.swf


f.Create a PDK Portlet (pdk version 10.1.2.0.2) using the Wizard just click and finish it. ( i selected a jsp file instead of a html file)

Used a div tag to embed the .swf file

g.Deployed the app, Register the provider, Published the Portlet.

Works Fine.

Tried to present the above in a picture






Please let me know your thoughts.




Thanks
Prem

Sunday, October 11, 2009

Oracle Cursor Leak

Hello All,

This week we had a problem with the cursors.:) ORA-1000

We made a change to our oracle portal website to use the App server Datasource instead of Apache BasicDataSource.


While testing this across instances we detected a cursor leak. As we all know again it was a problem with a stmt or result set object which was not closed.

Detecting the open result set/statement object is a bit tough job in a huge code base.

This is how the object was identified

Query to find our open cursors

select a.value, s.username, s.sid, s.serial#
from v$sesstat a, v$statname b, v$session s
where a.statistic# = b.statistic# and s.sid=a.sid
and b.name = 'opened cursors current' and username = 'EXTERNALPORTAL';


This gives the open cursor count and SID which opened it.

This returned me the sid 937 for my Application, used this sid against the V$open_cursor view.

for eg:

SELECT COUNT(*), address
FROM v$open_cursor
WHERE sid = 937
GROUP BY address HAVING COUNT(address) > 1 ORDER BY COUNT(*);


The result lists each cursor, which has been opened by the session more than once in descending order.

Returnes the count of cursor and the memory Address of the query which opened it.

SELECT sql_fulltext
FROM v$sql
WHERE address = '6C806444'


this returned me the query which created the issue. Just fixed the code. and monitored the cursor count for about a day it is good.


Thanks
Prem