Monday, October 01, 2007

BIRT Web Service ODA

In the August edition of Eclipse Magazine ( Virgil Dodson and I wrote an article on the use of the Web Service ODA that is new with BIRT 2.2. One option that we discussed was the use of a custom connection class, which allows the developer the option of specifying a class that will be called which will be responsible for retrieving the web service data. In BIRT 2.2 this feature was initially disabled. With the release of BIRT 2.2.1 this week this feature in now enabled. In addition the driver has been improved by adding a driver class path property to locate your custom connection class.

A custom driver class must implement one method named connect. This method should accept two parameters, which contain the connection properties and application context. This class should instantiate another class that implements an executeQuery Method and a close method. The executeQuery method should accept the queryText (SOAP Request), parameter values and data set properties as parameters. In the example from the article this connection class simply opened a FileInputStream which contained a SOAP response and returned the data.

To use this feature, you will still need to provide a SOAP endpoint or a WSDL document when configuring the Data Source. Although the WSDL document can reference methods that may never be called in your custom class, essentially making it a dummy WSDL. In the example you will note that the SOAP request is never used.

An example report and source code using this feature can be found here.

Virgil has also made improvements to the example since it was published , adding pagination and hyperlink controls for navigation which he included in his BIRT Exchange post.

By the way, if you're not familar with it, BIRT Exchange is a community site for BIRT developers that enables you to share code samples, report designs, technical articles, as well as tips and tricks. To read more about the site take a look at this blog.


azuri said...
This comment has been removed by the author.
Jay said...

When I attempt to load the example report and execute it, it fails with a class not found on my.web.service.MyWebService.

I tried adding both the classes directory from the project and the built jar file to the CLASSPATH env variable, with no luck.

What do I need to do to get Birt to recognize that class? I am using Birt 2.3.1 report designer.

Jason Weathersby said...

There is a classpath property for the web service data source. Can you try adding it to it. Or put it in the web-inf/lib directory of the viewer.

Jay said...

I was able to get it to work by adding it to the viewer plugins's scriptlib directory:



Jay said...

Sorry, by "it" I mean I added the project jar to the directory.

Rupesh said...

I am Rupesh
I create custom parameter page
i get fioolwing error


at javax.servlet.http.HttpServlet.service(
at org.apache.axis.transport.http.AxisServletBase.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
at Source)

Jason Weathersby said...

Can you post the code you used?

Driscoll Hunter said...

This category should instantiate another category that utilizes an executeQuery Technique and a near method.

sravani reddy said...

hello please tell me how to integrate the java with birt report ..when i click on the submit button, birt report is open that is my task..

can anyone help me please....

thank you.