Siebel Analytics Web Services

Siebel Analytics provides a Simple Object Access Protocol (SOAP) programming interface to extract and deliver data and manage the content of the Siebel Analytics Web Catalog. This document gives an overview on how to use this functionality to show a Siebel Analytics report in a HTML page.

Scope

This Proof of Concept (POC) involves the use of Java Development Kit, Apache Tomcat Server and Apache Axis apart from Siebel Analytics. This document only gives an overview of the SOAP Interface provided by Siebel Analytics and an example of how to use Java to display a simple report in a HTML page using the Web Services provide by Siebel Analytics.

A primer on Web Services and installation/ setup of the required software is beyond the scope of this document.

Siebel Analytics Web Services Overview

Siebel Analytics provides a set of web services which can be called by a third party HTML page to display an Analytics report/ dashboard. It also provides services to manage/ alter the structure of the analytics web catalog. The Siebel Analytics Web SOAP API allows external applications such as J2EE and .NET to use Siebel Analytics as an analytical calculation and data integration engine. It provides a set of Web services that allow external applications to communicate with the Siebel Analytics Web server. You can use the Siebel Analytics Web SOAP API to extract results from Siebel Analytics Web and deliver them to external applications and Web application environments.

The following Web Services are provided:

  • HtmlViewService Service– embeds Siebel Analytics Web HTML results in third-party dynamic Web pages such as Active Server Pages (ASP), Java Server Pages (JSP) and Portal frameworks.
  • MetadataService Service– retrieves descriptions of Siebel Analytics schema objects like tables, columns & subject areas.
  • ReplicationService Service– provides web catalog replication methods.
  • ReportEditingService Service– provides methods for passing and merging of report parameters and the Siebel Analytics Web data to create and return results.
  • SAWSessionService Service– provides authentication and other session-related methods.
  • SecurityService Service– provides methods for identifying accounts and privelleges.
  • WebCatalogService Service– provides methods for navigating and managing the web catalog and reading and writing web catalog objects in XML format.
  • XMLViewService Service– retrieves results from Siebel Analytics Web in XML format.

Siebel Analytics provides a WSDL for these web services, which can be accessed through the following URL http://some_host/analytics/saw.dll?WSDL. This describes all the information that is required to make a call to the Siebel Analytics Web.

Software Requirements

This Proof of Concept was executed with the following software:

  • Siebel Analytics 7.8.4
  • JDK 1.6
  • Apache Tomcat 5.5
  • Apache Axis 1.4

Assumptions

  • The reader has a basic understanding of Web Services and Siebel Analytics.
  • The reader should be conversant with Java.
  • All required software have been properly installed and configured.
  • Siebel Analytics is licensed for SOAP API.

Implementation Approach Overview

The following approach was taken to display a Siebel Analytics report in a HTML page.

  • The WSDL for the web services was accessed through http://AnalyticsPOC/analytics/saw.dll?WSDL.
  • The WSDL2Java utility of Apache Axis was used for getting the proxy classes from the WSDL.
  • The java client was written to make a call to the Siebel Analytics Web to get the report results and write the report HTML code to a HTML

 

The WSDL

The WSDL details all the information required for calling the web services from an external source. The WSDL for the Analytics SOAP API can be accessed through the following URL – http://AnalyticsPOC/analytics/saw.dll?WSDL. Here AnalyticsPOC is your analytics server. You will need to save this file with a .WSDL extension.

WSDL2Java Utility

The WSDL provides all the information required to make a call to the Siebel Analytics Web; however before the java client can be written the proxy classes need to be generated from the WSDL. Apache Axis provides a utility - WSDL2Java – for this. After correctly installing the JDK, Tomcat and Apache Axis the proxy classes can be generated by typing the following command on a DOS window.

java org.apache.axis.wsdl.WSDL2Java -Ncom.siebel.analytics.web/soap/v3 = com.siebel.analytics.web.soap -Ncom.siebel.analytics.web/report/v1 = com.siebel.analytics.web.report -Ncom.siebel.analytics.web/expression/v1 = com.siebel.analytics.web.expression WSDL_File.wsdl

Here WSDL_File.wsdl is the file to which you have saved the WSDL got from http://AnalyticsPOC/analytics/saw.dll?WSDL

After running this utility the following directory structure should get created - com\siebel\analytics\web\expression and com\siebel\analytics\web\soap. The former contains the java classes required for working with expressions and the latter stores the java classes for the web services. All the java code in these 2 folders needs to be compiled before they can be used in the java client.

The Java Client

The java client uses the proxy classes generated through the WSDL2Java utility to make a call to the Siebel Analytics Web to get the report definition and display write it to the HTML file.

For the purpose of this POC only two Web Services were used – SAWSessionService and HTMLViewService. The SAWSessionService is used to establish a session and logon to the Siebel Analytics Web. After this the HTMLViewService was used to get the HTML code for the report.

The HTML result of the report was written to a HTML file and the report was then viewed.

Challenges and Resolution

 

S. No.

Challenge

Resolution

1

While compiling the java code got the following error

 

Exception in thread "main" java.lang.UnsupportedClassVersionError: AnalyticsReport (Unsupported major.minor version 50.0

)

at java.lang.ClassLoader.defineClass0(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClassInternal(Unknown Source)

There were 2 different versions of JVM installed on the machine. The code got compiled in a higher version but while running the code a lower version of java was being used.

 

After removing the older version of JVM from the path things worked fine.

2

While generating the proxy classes for the WSDL the following error message was given

 

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/axis/wsdl/WSDL2Java

Set the CLASSPATH variable correctly

3

While generating the proxy classes for the WSDL the following error message was given

 

Exception in thread "main" java.lang.NoClassDefFoundError: javax.wsdl.Definition

at org.apache.axis.wsdl.toJava.JavaGeneratorFactory.class$(JavaGeneratorFactory.java:68)

at org.apache.axis.wsdl.toJava.JavaGeneratorFactory.addDefinitionGenerators(JavaGeneratorFactory.java:179)

at org.apache.axis.wsdl.toJava.JavaGeneratorFactory.addGenerators(JavaGeneratorFactory.java:133)

at org.apache.axis.wsdl.toJava.JavaGeneratorFactory.<init>(JavaGeneratorFactory.java:111)

at org.apache.axis.wsdl.toJava.Emitter.<init>(Emitter.java:159)

at org.apache.axis.wsdl.WSDL2Java.createParser(WSDL2Java.java:209)

at org.apache.axis.wsdl.gen.WSDL2.<init>(WSDL2.java:96)

at org.apache.axis.wsdl.WSDL2Java.<init>(WSDL2Java.java:194)

at org.apache.axis.wsdl.WSDL2Java.main(WSDL2Java.java:371)

Adding the jar file wsdl4j.jar to the CLASSPATH solved the problem

4

While generating the proxy classes for the WSDL the following error message was given

 

WSDLException (at /wsdl:definitions/wsdl:import): faultCode=OTHER_ERROR: Unable to resolve imported document at 'Wsdl/Sc

hemas/SAWServices.xsd', relative to 'file:/C:/Documents and Settings/shaild/Desktop/Kunal/Web Services POC/Code/java/saw

.wsdl': This file was not found: file:/C:/Documents and Settings/shaild/Desktop/Kunal/Web Services POC/Code/java/Wsdl/Sc

hemas/SAWServices.xsd: java.io.FileNotFoundException: This file was not found: file:/C:/Documents and Settings/shaild/De

sktop/Kunal/Web Services POC/Code/java/Wsdl/Schemas/SAWServices.xsd

at com.ibm.wsdl.util.StringUtils.getContentAsInputStream(Unknown Source)

at com.ibm.wsdl.xml.WSDLReaderImpl.parseImport(Unknown Source)

at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)

at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:516)

at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)

at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)

at java.lang.Thread.run(Thread.java:619)

 

at com.ibm.wsdl.xml.WSDLReaderImpl.parseImport(Unknown Source)

at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)

at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:516)

at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)

at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)

at java.lang.Thread.run(Thread.java:619)

The proxy classes were being generated on a different machine and the WSDL was pointing to a schema XSD which was on a different path.

 

After altering the WSDL file so that the path for the schema XSD was accessible the proxy classes were successfully generated.

5

On running the client to connect to the Webservice using the Logon() method of SAWSessionService a Soap Fault (Assertion Failure) is thrown.

The underlying cause for this were the changes made to targetNameSpace & ImportNameSpacein the WSDL. These namspaces had a ‘/’ in them due to which the classes that were created by the Axis WSDL2Java utility had a ‘/’ in the name of the package. This ‘/’ caused the compiler to fail.

 

There is a runtime parameter for WSDL2Java which can be used to specify the Namespace to Package mapping. After using that the Logon() method was running as expected.

 

The WSDL2Java command used was

 

java org.apache.axis.wsdl.WSDL2Java -Ncom.siebel.analytics.web/soap/v3=com.siebel.analytics.web.soap -Ncom.siebel.analytics.web/report/v1=com.siebel.analytics.web.report -Ncom.siebel.analytics.web/expression/v1=com.siebel.analytics.web.expression Analytics.wsdl

6

The HTML code being returned from the Analytics Web Server points to a few javascript and css files. The path of these files was not being set properly; there was ‘Missing_’ being prefixed to the name of the file. Because of this a scripting error “object is undefined’ was being thrown.

This was basically because the correct browser user agent was not being passed to the Analytics Web Server.

 

Instead of using the logon method of the SAWSessionService web service the longonex or impersonateex methods were used. These methods take the user-agent as an input parameter. The correct value for he user-agent can be got by typing the following command in the address bar of the browser

 

javascript:alert(navigator.userAgent)

 

This value needs to be passed as a string argument to the logonex/ impersonateex methods.

References

  • Siebel Bookshelf – eAI Volume II: Integration Platform technologies
  • Siebel Analytics Web Services Guide