Invoke Oracle BI Report using Web Services

Before we start, I am assuming that you have some knowledge of Oracle BI and PowerShell. You can use similar concepts to invoke Web Service using Python, Java, cURL. I will be writing another post on invoking the BI report using Python. This post focuses on a report developed in Oracle Cloud.

You may also read my previous blog on loading data from Oracle Cloud to Oracle EPM. In that post I utilized the ReportService web service. It worked pretty well.

However one of the drawbacks was the fact the user name and password were part of the payload, which is not a good practice.

In this post we will be looking at an alternate Web service; ExternalReportWSSService. As you will see later in the post, the advantage of this web service is that you can pass the authentication details as part of the Request Header. So let’s get started.

At a high level below are the steps involved in the process:

  1. Read BI login credential details
  2. Construct the SOAP request Header with authentication values
  3. Invoke BI Report
  4. Decode the base64 response and Generate CSV File

Rather than hard coding the username and password, I decided to store the username, password and wsdl end point in a file. This way you have the option of encrypting the username and password at rest. See the loginDetails.json file.

I have included default values for the username and password. Make sure you enter the correct username and password instead of the default values.

To invoke the BI report we need to pass the encrypted username and password as part of the Web Service Request Header. Here is the code snippet that performs the following operations:

  1. Read credential details from loginDetails.json file
  2. Encrypts the username and password
  3. Add the encrypted credentials to the Request Header

We will be utilizing the Oracle BI Publisher Web services in this post. To be more specific, we will use “ExternalReportWSSService” web service and “runReport” method.

The BI report has a parameter (see lines 6–13) and I will explain it later in the post. The output is in CSV format. Create a SOAP payload file as shown below and save it as EPM_Account_Hierarchy.xml.

There are three important fields that you have to populate:

  1. reportAbsolutePath : Path to the report / .xdo file (line 14)
  2. name: Parameter Name (line 8) defined in Oracle BI
  3. item: Parameter Value (line 10)

Here is the code snippet to invoke the BI Report

The response from web service is in base 64 encoded format. The next step is to decode it and save the data to a csv file. Use the below code snippet to decode the response and generate a CSV file.

I hope you find this post to be helpful. Feel free to ask me questions on this process. If you want the complete code, head on over to my GitHub repository.

In the next post, we will take a look at the same process using Unix Shell Script.

Manager Strategic Cloud Services (Oracle Cloud ERP, EPM), Integration Specialist, Big Data, Data Science & Python Enthusiast)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store