Oracle Customer Engineering & Advocacy Lab (CEAL) Blog covers Oracle Analytics Cloud, Oracle Analytics Server and...

OBIEE Web services with javascript

OBIEE web services provide a large set of operations on ibots, jobs, metadata, analysis, webcat...

A wsdl is provided for these services, and it is common to call them in a process running in Weblogic server (java custom application).  However, it is also possible to call them using javascript in a browser, or in a server with a javascript engine (Nodejs.org, or else).
The main limitation for the browser resides in the cross domain calls being blocked for security reasons. In this case, the javascript code has to be deployed in a webapp in the same domain as obiee (like http://obieeserver:port/yourwebapprootcontext)

It is rather practicle for tests purposes to use a javascript obiee web service client.

To create the javascript client from the obiee wsdl, use Apache CXF wsdl2js utility. http://cxf.apache.org/docs/wsdl-to-javascript.html

  • For BI Publisher:

Services available here: http://server:port/xmlpserver/services
For example you can use this wsdl for the scheduler: http://server:port/xmlpserver/services/v2/ScheduleService?wsdl

In a shell:
set PATH=C:\apache-cxf-2.7.7\bin;C:\Oracle\Middleware\Oracle_Home\oracle_common\jdk\bin;%PATH%
set JAVA_HOME=C:\Oracle\Middleware\Oracle_Home\oracle_common\jdk

cd /d c:\mywsdltojsfiles

wsdl2js -p soap http://server:port/xmlpserver/services/v2/ScheduleService?wsdl

This creates this file:

  • For Obiee soap web services:

Create the js files using wsdl2js and http://server:port/analytics/saw.dll?privateWSDL
Operations are described here: http://docs.oracle.com/cd/E21764_01/bi.1111/e16364/methods.htm

This generates these files:
SAWSessionService.js for getting a sessionid
the other services: WebCatalogService.js, IBotService.js and so on

  • For obiee bisecurity web service: this is using ws-security for login, and this requires a change in generated js files for the login to work (this requires a specific soap header). Not covered in this blog since bisecurity web service is not supported as a client api for use by customers/partners.

Then you can call the generated functions this way (example with obiee soap web service):

  • Make sure you include the generated js, as well as cxf-utils.js
  • Create a new js:

// Get a sessionid
     var loginPort=new SAWSOAP_SAWSessionServiceSoap();
     if (url) loginPort.url=url+"?SoapImpl=nQSessionService";
     var sessionID="";
        function (responseObject) {
            console.log("Call succeeded -> Sessionid:"+responseObject.getSessionID());     
     console.log("Done sessionid:"+sessionID);

// call ibot service to send message through default delivery channels
     var ibotPort=new SAWSOAP_IBotServiceSoap();
     if (url) ibotPort.url=url+"?SoapImpl=ibotService";

     var message="This is my message";
     var groupArray=[];

    ibotPort.sendMessage(successCallbackSendMessage, errorCallback, '',groupArray, 'OBIEE IBOT message',message,'Normal', sessionID );

With the call backs for the async calls:

function errorCallback(httpStatus, httpStatusText)
    globalErrorStatus = httpStatus;
    globalStatusText = httpStatusText;

    console.log("Error:"+httpStatusText+" "+httpStatus);
function successCallbackSendMessage(responseObject)
 console.log("Call succeeded: message sent");

Example with getting the most recent used items through the web service:

function getMostRecentUserItemsLists(loginPort,sessionID) {
     loginPort.getUserLists(successCallbackUserItemsLists, errorCallback, sessionID);
     console.log("Done users list");    


function successCallbackUserItemsLists(responseObject)
  console.log("Call succeeded: userlists:"+responseObject.getReturn());
  var i=0;
  var mruList;


  // display last mru

  if (mruList.length>0) {
   var recentItem=mruList[0];
    var path=recentItem.getPath();
    var sig=recentItem.getSignature();
    console.log("mrulist length:"+mruList.length);
    if (mruList.length>1) {


Join the discussion

Comments ( 1 )
  • guest Sunday, November 29, 2015

    cool thanks

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.