Business Intelligence - Oracle

Customizing OBI EE - SOAP API

Posted by Venkatakrishnan J on July 31, 2007

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.

                                  obiee_soap.jpg

                                  obiee2_soap.jpg

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)

                                    obiee3.jpg 

2.       Create a new Package within the Applcation.

                                    obiee4.jpg

Use Web Service Proxy technology to create it.

                                    obiee5.jpg  

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.           

For example,

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.          

For example,

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.          

For example,                   

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.

 

 

                               obiee6.jpg

 

5. Once this done the next step is to generate html output for the report.          

For example,

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.

21 Responses to “Customizing OBI EE - SOAP API”

  1. Alexander Says:

    Hi, thanx for useful blogging.
    Looks that you’re more experiensed in OBI than me, i got a Q to ask: I’m trying to use SOAP API to embed OBI report to another webapp’s page (via HTMLViewService as you described). Everithing is OK, but all interactive report’s elements (such as drill down links, piviot table paging, etc..) are corrupted. My guess, this happend becoz authentication session (SAWSession logon) didn’t passed from server to client side, so any request from web browser to bridge looks like:
    appserver.com:80 192.168.221.5 - - [26/Jul/2007:16:40:53 +0500] “POST /bridge?RedirectURL=saw.dll%3fNoAuthGo HTTP/1.1″ 400 - 0 “http://appserver:8080/oracbiee/report1.php” “Mozilla/5.0 (X11; U; Linux i686; ru; rv:1.8.1.5) Gecko/20070713 Firefox/2.0.0.5″ “- - -” “- -”
    I totaly stuck with it. Do you have any suggestions?

  2. Venkatakrishnan J Says:

    Hi Alexander. Thanks for your comments. Can you try extracting the logical sql query part by using the generateReportSQL method of the reportEditng service? If you are able to get the sql back, then i believe its not an issue with session maintanence. But if you are not able to get back the sql, can you try using the keepAlive method of SAWSession service. This way we can ensure that the session does not get timed out.

  3. Alexander Says:

    I can invoke almost any method of OBI SOAP API via SOAP client deployed on my appserver without errors. But what happend when user (who even doesen’t know about OBI existence) got my custom webpage with OBI report embedded and then clicks on drill down link? I think it’s simple HTTP POST (log entry from prev. message) request from *browser*. But how can that Javascript engine on client side (which generates that HTTP POST) should obtain auth session identity from my SOAP client which is olny already authenticated?
    P.S. keepAlive() didn’t help either :(

  4. Venkatakrishnan J Says:

    Apologies for the delay. Was out on a week long vacation. Can you let me know whether the issue is only with the drill paths or are they for the entire report. I mean, can you render your report completely without having the drill downs at all?

  5. Alexander Says:

    Hello again. Yes a can render any report and it looks well. Drills and paging buttons also presents but not works properly (whole report just collapses when user clicks on it) . :(

  6. Richard Says:

    Very nice blog.
    Iam trying to get my hands wet on OBI integration with a Web service
    and facing bottlenecks.
    Iam able to retreive the BodyHtml and HeaderHTML string from the Soap API call
    but when i put these together on HTML page a blank page is displayed.

    I tried stripping the IFRAME src from getHtmlForReport() method and run it in a browser still nothing ..
    SRC=”http://XXXX/analytics/saw.dll?HtmlSoapGetReport&NQID=r63m6q0o29k1p0po36e1b7qnfu7qadvq2s3krvizOr07UFe9W00&SearchID=1r81h804oeq6ht01f1q7edg7de&ReportID=m%3aportlet%7er%3aDev”

    If i do a view source i can see the rport Data embedded with the meta data.
    Any help is appreciated.

  7. Alexander Says:

    Oh It’s kinda forum! :)..
    2Richard: do you have bridge script properly configured?

  8. Richard Says:

    Alexander. Thanks for the response.
    I am novice to Oracel BI :)
    In my setup the Web application and OBI are running on a different machines.

    Iam trying to run the IFRAME URL generated by the Soap call to HTMLOutput web method.
    So iam running the following URL directly in the browser .. http://XXXX/analytics/saw.dll?HtmlSoapGetReport&NQID=r63m6q0o29k1p0po36e1b7qnfu7qadvq2s3krvizOr07UFe9W00&SearchID=1r81h804oeq6ht01f1q7edg7de&ReportID=m%3apoSSS
    iam getting the complete data on the page ( checked through ‘View Source’ on browser.) but the data is not displayed on screen. :(

    I think my next step would be to setup the Bridge using Stebridge to view the content within my web App right?
    I might be totally off on this.

  9. Venkatakrishnan J Says:

    @Richard - Alexander is right. You need to set up the bridge since you have the BI Web Service and the calling web server on different machines.
    @Alexander - Can you check the ReportHTMLOptions Structure? You have a structure called ReportHTMLLinksMode that can set the drill links.

  10. Dev Vinod Says:

    Iam trying to integrate a BI report onto my cust application running on two different servers.
    Iam getting access denied error when the Client HTML’s IFrame’s document object is being accessed
    by the Javascript located at the OBI server.
    On further checking i found IE 4 and above does not allow cross site scripting.
    http://support.microsoft.com/kb/167796

    I ran the same HTML file in Netscape . It works there.
    From all the posts out here i feel everyone is running on Mozilla ..Has ayone run this IE?

  11. Dev Vinod Says:

    Alexander,
    Could you tell me how i should be setting up the bridge scripts?

    Any inputs is appreciated.
    Have already spent a lot of time to figure this out :(

    Thanks

  12. Venkatakrishnan J Says:

    I believe it is documented in detail in the web services guide. Is there any step from which you are not able to move forward? Or can you let me know what is the issue that you are facing?

  13. daniel Says:

    Hi.
    It’s a very interesting post. Do you think the Answers tooltip functionality (displaying descriptions set on the Presentation layer) can be duplicated or made available in Dashboards using SOAP calls?

  14. majendi Says:

    Venkat

    Have you ever tried to get APEX to call an OBIEE web service?

    Adrian

  15. Venkatakrishnan J Says:

    Yes Adrian. I have tried that before. We cannot use OBI EE SOAP APIs directly within APEX since OBI EE SOAP APIs has multiple SOAP bindings. It will give you an error. BI Publisher APIs will work just fine since it has only one SOAP binding but not OBI EE.

    Venkat

  16. Tina Says:

    Hi,Venkatakrishnan
    I encounter the same problem as Richard’s.
    I have set the bridge using htmlClient.setBridge(”http://myserver:9704/analytics/sawbridge”,sessionID);
    Problem still exist.
    Even when i re-deploy my apps on the same server as BI Presentation Server,problem the same.
    I am wondering that,even cannot we visit sawbridge thru http://myserver:9704/analytics/sawbridge,how can the setBridge work?

    Regards,
    Tina

  17. Sandeep Singhal Says:

    I have the same problem as Tina. My code is giving an access denied error when I integrate the HTML received from oracle SOAP APIs. Anyone knows a workaround ?

    - Sandeep

  18. phatfield Says:

    Hello,

    I was wondering where you add the code to set session variable values for the report you are embedding in another application. I am doing something similar to what you describe but I need to also set some values for some pre-created Session Variables within the BI Server RPD. I need those values updated by each user and I have checked that feature on in the variable definition. I don’t want to look up the value in a database so I have disabled the initialization block associated with that Variable and want the user session to update the variable value from another Java application that will maintain the session. What does that syntax look like to set the variable value and where do I put it? Thanks for any guidance on this.

  19. Sudhir Says:

    Hi,Venkatakrishnan

    Very useful blog. I am trying to use XMLViewService.getResults api. I was successful in getting a report result in xml format without providing any filter/ params. However, when I tried to use ReportParams it fails. I get either failed to generate xml or Assertion failure. Any suggestions, like the format of the params I should use.

    Thanks
    Sudhir

  20. Angelo Gonzalez Says:

    Hi,Venkatakrishnan

    How can i make the bridge script properly and configured it?

    Thank you

    PD: PD: Please help me with this i found your blog and i think that is very helpful

    Regards,
    Angelo

  21. Rajan Says:

    Hi Sudhir:

    Could you please share the code for XMLViewService.getResults API?I am getting an error.

    Venkatakrishnan/ All: As per your example, I am getting the mypage1.htm with a IFRAME but it is EMPTY.

    Any suggestions ?

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>