As I was writing my blog yesterday on using URL parameters as a customizing option, it made me think about the availability of open API’s for OBI EE. As luck would have it, I had some time yesterday to work on the API’s and this blog is a result of that. In this article, we would be seeing how to use SOAP API of OBI EE from JDeveloper. One of the major advantages of OBI EE is that it opens itself for developers in the form of standard API’s. Almost all the functionality is exposed and it would enable customers to use these API’s within their application code sets and thereby enabling complete integration. Here, we would basically be seeing how to go about using the SawSession service and the HtmlViewService to view a simple report. The SawSession service helps is maintaining sessions & authentication. The HtmlViewService helps in actually extracting the layout of a report. The SOAP API works on the WSDL implementation within OBI EE. If you navigate to http://localhost:port/analytics/saw.dll?WSDL one can obtain the WSDL schema information.
One can use the Mindreef SoapSCOPE evaluation copy to go through the WSDL.
One can test each of the invoking methods using this. But the only major problem with this evaluation copy is that you cannot maintain session state. Hence it would be difficult to test all the methods available. Now lets look at the various services that are available.
1. Security Service
2. Ibot Service
3. Web Catalog Service
4. Replication Service
5. Metadata Service
6. ReportEditing Service
7. HTMLView Service
8. XMLView Service
9. SAWSession Service
Security Service: This service helps in identifying the user priveleges. One can assign, revoke privileges using Security Services.
Ibot Service: As the name suggests, this is a service for invoking Ibots.
Web Catalog Service: This service is for managing the web catalog.
Replication Service: This service is used for replication. Export/Import of catalogs can be done using this.
Metadata Service: This is for managing the BI Server metadata.
ReportEditing Service: This service is used to merge arguments and Oracle BI Web Services data to create and return the results.
HTMLView Service: This service is used to embed Oracle BI HTML results in third-party dynamic Web pages, such as Active Server Pages (ASP) or JavaServer Pages (JSP), and portal frameworks. The embed process merges Oracle BI Web Services content with the content of third-party Web pages.
XMLView Service: This is used for retrieving the data from Oracle BI EE Server in the form of XML.
SAWSession Service: This is the service that would enable users to login, logout and maintain sessions. Now lets see how we can go about using these services from within Jdeveloper to create a sample custom report.
1. Open Jdeveloper and create a new application. (With no templates)
2. Create a new Package within the Applcation.
Use Web Service Proxy technology to create it.
Invoke all the methods that you need. In our example, we will be including the SAWSession service, the HTMLView Service and the XMLView Service.
3. The next step is to create an object for SAWSession Service and invoke the logon method.
soaptest.SAWSessionServiceSoapClient myPort = new soaptest.SAWSessionServiceSoapClient();
sessionID = myPort.logon(“Administrator”,”Administrator”);
This would create a session.
4. Once a session is created, the next step is to create a pageID for that session. A page is nothing but an entire html page that might contain multiple reports. This uses the HTMLView Service.
soaptest.HtmlViewServiceClient htmlClient = new soaptest.HtmlViewServiceClient();
pageID = htmlClient.startPage(newPage,sessionID);
5. After creating the pageID, create multiple report Ids that you would like to associate with a pageID.
htmlClient.addReportToPage(pageID, reportID, newreportRef, null, null, null, sessionID);
Here, newreportRef uses a Reference structure like this
ReportRef newreportRef = new ReportRef();
newreportRef.reportPath = reportPath;
newreportRef.reportXml = reportXML;
For specifying a report one would have to specify 2 values. One is the report path and the other is the report definition. Both can be obtained from the report definition properties.
5. Once this done the next step is to generate html output for the report.
htmlOutput = htmlClient.getHtmlForReport(pageID, reportID, sessionID);
For future reference, I have uploaded the entire code here. One can use this for reference. This just shows the extensibility of OBI EE. Also, one can call BPEL processes from within BI EE to make educated business decisions. Mark Rittman has already blogged about that here. Interesting post considering the fact it is gaining more and more traction in the customer environments. I just had a customer who had this query and i was more than happy to direct them to Mark’s blog just to give them an idea and of course the documentation. The power of community is so good in this regard and it has helped me out a lot of times. If you want to know more about the open API’s they are available here. Just in case you want to do the same with BI Publisher they are available here. You might want to check out this blog by Vlamis and his team for giving out excellent articles on OLAP and DW in general. Also, if you are passionate about discoverer check out Michael Armstrong-Smith‘s blog.