Like what you see? Have a play with our trial version.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Tip

You need to have a Yellowfin user with rights role functionality to perform web services calls. Ensure that this is turned on in the user role. Click here to learn how that is done.

...

API can be called internally under Yellowfin Tomcat using JSP. The code samples can be found in the yellowfin/development/examples/webservices folder, once Yellowfin is installed. All you need to do is to copy the JSP files into the Yellowfin/appserver/webapps/ROOT folder and adjust the host, port number, and user details in the JSP these files according to your environment. We recommend ensuring that you can achieve what you want using this method prior to replicating this with other languages or environments.

 

However, you You can also still call web services services externally, that is outside of Yellowfin Tomcat. To do so, you will need:

  • yfws-<date>.jar which can be found in the development/lib folder in the Yellowfin directory. 

    Note

    Do not forget to get a new yfws-xxx.jar file after a Yellowfin upgrade (you need to download a corresponding yfws-xxx.jar file from the Yellowfin website).


  • Apache Axis: Refer to https://axis.apache.org/axis/ for more information on this.

 

A full objects’ definitions object definition can be found at Yellowfin/development/doc/webservices/Javadoc/index.html

There are two ways of calling Java API, as covered in the following sections.the Yellowfin Web Service API: via pre-built Java functions or by performing SOAP calls. Choosing a method is largely dependant on your application environment. If you have a Java environment, the recommended method would be to use pre-built Java functions, otherwise you can perform SOAP calls manually. 

Using Pre-built Java Functions

You can use pre-built Java functions to call Yellowfin API. This makes development a little bit easier as you are using pre-built functions, rather than configuring each request manually.

Tip

The code samples regarding this method can be found in the development/examples/webservices folder. See the jsp files with ‘api’ in their names. A good starting point is copying files with ‘mobile’ in their names, into the Yellowfin ROOT folder and exploreexploring.

 

Anchor
soapcalls
 
soapcalls

Performing SOAP Calls

Performing You can perform direct SOAP calls using Java generated stubs off Yellowfin WSDL.

All the code samples under in the Administration Service and Report Service sections are explained using SOAP calls in Java. In this Wiki, all the examples of using Yellowfin web services All the web service examples included here are explained assuming that you will call Yellowfin API from a Yellowfin Tomcat server (that means you use JSP and all your files go to Yellowfin/appserver/webapps/ROOT folder). Using languages other than Java will not bring much complexity to the code.

 

Initializing Administration Web Services

Use this command to initialize the Administration web services:

Code Block
languagejava
AdministrationServiceService s_adm = new AdministrationServiceServiceLocator(<host>,<port>,<ServicePath>, <ssl>);        

AdministrationServiceSoapBindingStub adminService = (AdministrationServiceSoapBindingStub) s_adm.getAdministrationService();

  

Initializing Report Web Services

Use this command to initialize the Report web services:

Code Block
languagejava
ReportServiceService s_rpt = new ReportServiceServiceLocator(<host>, <port>, <ServicePath>, <ssl>);

ReportServiceSoapBindingStub reportService = (ReportServiceSoapBindingStub) s_rpt.getReportService();

 

See below for an explanation of these parameters:

The primary objects include:


The primary objects included in these parameters are (covered in detail in the Administration Object Definition section):

 

Storing Yellowfin Session IDs

Every web service response retrieves a Yellowfin session ID. Each time a call is made

Expand
titleAdministrationServiceRequest

 

This object defines the type of call being made to the web service.

 

Object parameters:

Parameter NameTypeDescription
sessionIdString 
loginIdStringThis refers to a Yellowfin account with the web services role enabled. Must be a Yellowfin default (primary) org user.
passwordStringThis refers to the password of the above account.
ntlmBoolean 
orgIdIntegerThis should be always 1, which signifies the default org ID.
loginSessionIdString 
orgRefString 
queryString 
reportIdInteger 
dashboardTabIdInteger 
functionStringThis refers to the type of the call.
personAdministrationPerson 
groupAdministrationGroup 
reportAdministrationReport 
clientAdministrationClientOrg 
reportGroupAdministrationReportGroup 
favouritePersonFavourite 
contentResourcesContentResource[] 
importOptionsImportOption[] 
roleAdministrationRole 
retrospectiveDaysInteger 
binaryDatabyte[] 
peopleAdministrationPerson[] 
datasourceAdministrationDataSource 
sourceClientLinkAdministrationDataSourceClientLink 
sourceIdInteger 
scheduleAdministrationSchedule 

 

All parameters have corresponding “get” and “set” methods. For instance:

Code Block
languagejava
AdministrationServiceRequest sr = new AdministrationServiceRequest();
sr.setSessionId(savedSessionID);

 

It is not necessary to define all the parameters; each web service call has a list of the required parameters. Unspecified parameters will have a null value by default.

There are, however, mandatory parameters for any request, listed below:

  • loginId
  • password
  • orgId
  • function

Other parameters will be required depending on the function value.

Each request must contain the web service user details, that is who can call Yellowfin web services. This must be an existing user with the “Web services” role enabled, and these details should be specified as loginId, password, orgId.

 

Expand
titleAdministrationServiceResponse

 

This object is returned by the web service.

 

Parameters of this object:

Parameter nameType
ReportId Integer
StatusCode String
ErrorCode Integer
Messages String[]
SessionId String
LoginSessionId String
person AdministrationPerson
peopleAdministrationPerson[]
group AdministrationGroup
groups AdministrationGroup[]
roles AdministrationRole[]
reports AdministrationReport[]
reportGroups AdministrationReportGroup[]
report AdministrationReport
clients AdministrationClientOrg[]
client AdministrationClientOrg
personfavourites PersonFavourite[]
binaryAttachments ReportBinaryObject[]
contentResources 

ContentResource[]

importIssues ImportIssue[]
EntityIdInteger
parentDashboard ParentDashboard
parentDashboards ParentDashboard[]
parentReportGroups ParentReportGroup[]
binaryData String
contentType String
fileName String
queryResults ReportRow[]
datasources AdministrationDataSource[]
loadedDataSource AdministrationDataSource
schedule AdministrationSchedule

 

All parameters have corresponding “get” and “set” methods. For instance:

Code Block
languagejava
AdministrationServiceResponse ssr = doWebserviceCall(sr);

String statusCode = ssr.getStatusCode();

 

 

 

Yellowfin Session ID

Any response retrieves Yellowfin session ID. Each time you call to Yellowfin without specifying a session ID, Yellowfin opens a new session. It This is not suitable for some web services (like passing cases (for instance, if trying to pass dashboard filters to dashboard reports; , all the reports must be called within the same Yellowfin session) or as there may be a memory issue with too many sessions being opened. You can save response sessionId parameter and feed that To overcome this problem, you could store the response parameter, sessionId, and pass it to the next calls:

Code Block
languagejava
String savedSessionID = ssr.getSessionId();

...

AdministrationServiceRequest sr = new AdministrationServiceRequest();
sr.setSessionId(savedSessionID);


 

Code Samples for Administration Services

Assuming you have Yellowfin running on 8080 http port 8080 with SSL disabled, initializing see the following example to initialize an Administration service will be:

Code Block
languagejava
AdministrationServiceService s_adm = new AdministrationServiceServiceLocator("localhost",8080,"/services/AdministrationService", false);

AdministrationServiceSoapBindingStub adminService = (AdministrationServiceSoapBindingStub) s_adm.getAdministrationService();

 

Once you configure the request, you can call Yellowfin using the remoteAdministrationCall() function of the AdministrationServiceSoapBindingStub object:

Code Block
languagejava
AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);

 

Code Samples for Report Services

Assuming you have Yellowfin running on 8080 http port with SSL disabled, initializing Report service will be see the following example to initialize a Report service:

Code Block
languagejava
ReportServiceService s_rpt = new ReportServiceServiceLocator("localhost",8080,"/services/ReportService", false);        

ReportServiceSoapBindingStub reportService = (ReportServiceSoapBindingStub) s_rpt.getReportService();

 

Once you configure the request, you can call Yellowfin using the remoteReportCall() function of the ReportServiceSoapBindingStub object:

Code Block
languagejava
ReportServiceResponse rs = reportService.remoteReportCall(rsr);

 

 

Other Languages

When developing against Yellowfin web services, it is possible to generate functional stubs against the WSDL definitions. These definitions can be found at http://<yellowfin-server>:<port>/services, for instance, http://localhost:8080/services.

The functional stubs will allow developers to make standard function calls in their native programming language which will directly communicate with the Web Services provided by Yellowfin. The process of creating function stubs should also generate any objects required by the web service.

 

Expandtitle

Microsoft .Net

integration 

Integration

With .NET, we recommend generating stubs from JAX web services. You should be able to hit the JAX web services at: http://<yellowfin-host>/webservices/Hello. It will display

something like this

a page with WSDL URLs:

Image Removed

Image Added

Connect your clients to the listed WSDL URLs.

 

Note

There may be issues where data types between Java and .Net are not compatible. For example, Integer types that send through zero, rather than null. You might need to manually change the References.cs file to update the datatypes.

 

 

expand

title

PHP

 

You can use Axis generated WSDL (http://<yellowfin-server>:<port>/services) with

PHP. See examples of performing SSO using

PHP.

 

 

 

 

Section


Column
width75

Previous topic: Enable web services


Column
Next topic: