Eloise
Eloise

Reputation: 539

BIRT - Can we create a datasource calling a Rest web service?

I've a basic question.

I saw a lot a posts that speak about SOAP datasource. But can we create a REST web service data source ? With header and Body?

I need to be able to call multiple REST web services because I will give informations in the header of the last one...

Thanks,

[I edited the post like 3 times to add a Hello... But don't want to print...]

Upvotes: 1

Views: 1636

Answers (1)

chrism2112
chrism2112

Reputation: 36

I had similar needs and built a REST data source client for this purpose for a particular app/server I'm retrieving data from using the BIRT "POJO datasource". So basically created a separate Java client using Apache HTTP Client code along with some json parsing lib. I also have some special auth needs (Oauth etc..)that I need to implement to go along with that.

Wrapped that REST client code in a BIRT POJO datasource interface (really just a class that implements the open(),next(), close() methods as documented) and gets hooked it up in my report design. I can pass report parameters from BIRT into that interface which the client code can parse out to further specify specific data to be returned. When you define your dataset in BIRT based on that pojo you can pick and choose the class getter methods on the returned objects that will represent the data you specify for your dataset. Thre are some good videos out there Pierre (Actuate) and others on the process.

Basically POJO allows you do to anything you want but you have to write the code yourself :-)

Upvotes: 2

Related Questions