czwartek, czerwca 26, 2008

NetBeans SOA with Oracle

NetBeans is the default IDE for OpenESB platform and uses SOA Pack common with Sun JCAPS. JCAPS comes with DataDirect OEM JDBC driver for Oracle and somehow NetBeans doesn't fully support Oracle JDBC driver - it can't generate WSDL file for SQL Module operations. I have fixed this limitation and you can download SQL Module supporting Oracle JDBC driver from NetBeans Bugzilla.


Here you can see bug report. While generating WSDL for database operation SQL Module tries to get some description of parameters used in prepared statement. However Oracle JDBC driver doesn't have this information until after the statement is executed. As a result in NetBeans messages.log you can see:

java.sql.SQLException: Handle does not exist: getMetaDataorg.netbeans.modules.sql.project.dbmodel.DBMetaData.getPrepStmtResultSetColumns

From NetBeans Bugzilla you can get patch. NetBeans SOA Pack sources are available at hg.netbeans.org (there is mercurial package for Unices and TortoiseHg for Windows). You can do patching yourself or download fixed jar file. But...

if you download new OpenESB build every two weeks the jar file will probably have wrong version number of module. Unpack jar and fix it inside MANIFEST file.

Here is some Oracle function created few posts ago.

Let's try to generate WSDL for it.

OK, it probably worked. Now create new CompositeApplication, drop inside SQL Module, call 'Clean and Build'...

... add SOAP port, deploy CompositeApp...

and run Test Cases...

(remeber to set port for SOAP endpoint)

You should have now WebService for you DB operation.

0 komentarze: