From many days I was thinking to blog on Web Services using .net, today I could able to make it.
If you want to see what are all available web services in Bi Server then just browse this url in any browser http:///analytics/saw.dll?WSDL you will be able to see all available services.
Here is a very basic code (kind of hello world) in C# which will logon user to BI server and get the report results.
To do that, go to report's advanced tab collect Request XML, then create project in visual studio and web reference to project as show in fig.
As per our requirement we need following class objects to achieve our task
SAWSessionService, ReportRef, XmlViewService.
Here is code which will authenticate user and gets report results as xml string.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using saw = Obiee_Services.web_Reference;
using System.IO;
using System.Data;
namespace Obiee_Services
{
class HelloWorld
{
static void Main(string[] args)
{
var sawservice = new saw.SAWSessionService();
//Give user credentials who has soap access.
var sessionID = sawservice.logon("Administrator", "");
var repRef = new saw.ReportRef();
//Pass report name along path and Request XML to ReportRef object
repRef.reportPath = @"/users/administrator/#cachehitsbyusers";
repRef.reportXml = "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"xmlVersion=\"200705140\"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"xmlns:sawx=\"com.siebel.analytics.web/expression/v1\">\" \"columnID=\"c1\"/>formula=\"SUM(S_NQ_ACCT.NUM_CACHE_HITS)\"columnID=\"c4\"/>";
var xmlViewService =new saw.XmlViewService();
var xMLQueryExecutionOptions = new saw.XMLQueryExecutionOptions();
xMLQueryExecutionOptions.maxRowsPerPage=100;
xMLQueryExecutionOptions.refresh = true;
//Pass report parameters if you have
var reportParams = new saw.ReportParams();
//Execute XML Query
var queryResults = xmlViewService.executeXMLQuery(repRef, saw.XMLQueryOutputFormat.SAWRowsetSchemaAndData, xMLQueryExecutionOptions,reportParams, sessionID);
//Output as you required
System.console.write(queryResults.RowSet);
sawservice.logoff(sessionID);
}
}
}
There are around 10 main classes and each has its own functionality.
"HtmlViewService" to embed Oracle BI HTML results into ASP or JSP or Web Portals
"IBotService" to execute Oracle iBots programmatically
"JobManagementService" to manage all jobs related things
"MetadataService" to retrieve description of columns, tables, and subject areas etc
"ReplicationService" to provide methods for replicating catalog
"ReportEditingService"to merges arguments with services data as users needed
"SAWSessionService" provides authentication related stuff
"SecurityService" to identifying accounts and there privileges
"WebCatalogService" for navigating and managing the Presentation Catalog
"XmlViewService" retrieve results from BI Web Services in XML format
http://download.oracle.com/docs/cd/E10415_01/doc/bi.1013/b31769.pdf this pdf covers all available class and respective methods exposed to end users.
--Hope you have enjoyed.