0 Replies Latest reply on Oct 6, 2014 12:38 AM by Josh6847

    HtmlViewService in OBIEE 11g Web Service API is not rendering report (only getting the spinning loader/clock)

    Josh6847

      I have a Java application that leverages the OBIEE Web Service API to consume data from the BI Server. I am able to XMLViewService and the WebCatalogService just fine, but I can't quite get the HtmlViewService to properly render a report in the Java app. The report just shows the spinning loader, but never actually renders the report. I'm pretty sure it has to do with the fact that the Java app and the BI Server are on different domains. This is what the API documentation says:

      In situations where Oracle BI Web Services and the third-party Web server do not belong to the same Domain Name Service (DNS) domain, users may get JavaScript errors related to browser security constraints for cross-domain scripting. To avoid these issues, use the setBridge() method to modify callback URLs to point to the third-party Web server. Be aware that a Web component executed by the third-party Web server to re-route requests to Oracle BI Web Services is not provided. This function would need to be fulfilled by the third-party application.

      Several years ago, I did this same type of integration using .NET/C# and ran in the the same issue because the .NET app and the BI Server were on different domains. As a result, I had to create an HTTP Handler (.ashx file) as well as use the setBridge() method to to solve the issue. Here is my OTN discussion from when I was doing this in .NET:

      OBIEE's Web Service SOAP-API + HtmlViewService + Access is Denied error

      The challenge that I'm having is that I can't find a servlet bridge example for Java. And I'm not too confident in porting the .NET/.ASHX code to a Java servlet/bridge. Does anyone have any code examples or direction they could provide to point me in the right direction? Here's a snippet of code to show you what I'm doing to pull back the report data:

         // define report path
        
      ReportRef reportRef = new ReportRef();
         reportRef
      .setReportPath(reportFolder + "/" + reportName);

        
      // set page params
        
      StartPageParams pageParams = new StartPageParams();
         pageParams
      .setDontUseHttpCookies(true);

        
      // set report params
        
      String pageId = htmlService.startPage(pageParams, sawSessionId);
        
      String reportId = pageId + reportName;
         htmlService
      .addReportToPage(pageId, reportId, reportRef, null, null, null, sawSessionId);

        
      // get report html
        
      StringBuffer reportHtml = new StringBuffer();
         reportHtml
      .append(htmlService.getHtmlForReport(pageId, reportId, sawSessionId));

        
      // return html
        
      return reportHtml.toString();

      This is the error that is coming back in the browser:

      XMLHttpRequest cannot load http://12.20.10.11:7001/analytics/saw.dll?ajaxGo. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.