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

Error rendering macro 'rw-search'

null

Versions Compared

Key

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

...

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 explore.

 

 

Performing SOAP Calls

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

All the code samples under Administration Service and Report Service sections are explained using SOAP calls in Java. In this Wiki, all the examples of using Yellowfin web services are explained assuming that you call Yellowfin API from Yellowfin Tomcat (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.

 

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();

 

 

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:

ParameterTypeDescription

host

String

Yellowfin server (can be server DNS name, IP address, URL or “localhost”)

port

Integer

http port number to access Yellowfin server

ServicePath

String

Path to the service

Administration service path: "/services/AdministartionService"

Report service path: "/services/ReportService"

ssl

Boolean

If SSL enabled: true


The primary objects include:

Expand
titleAdministrationServiceRequest

 

This An object that 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. If you do not specify parameters of the call, they Unspecified parameters will have a null value by default.

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

  • loginId
                                      - Yellowfin account with web services role switched on and must be Yellowfin  default (primary) org user;
  • password
                                 - password of the above account
  • orgId
                                          - should be always 1 which is default org ID.
  • function
                                   - type of the call.

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 webservicesweb services. This must be an existing user with “Webservices” role being tickedthe “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 is not suitable for some web services (like passing dashboard filters to dashboard reports; all the reports must be called within the same Yellowfin session) or there may be memory issue with too many sessions being opened. You can save response sessionId parameter and feed that to the next calls:

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

...

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


 

Code Samples

Assuming you have Yellowfin running on 8080 http port with SSL disabled, initializing 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 remoteAdministrationCall() function of AdministrationServiceSoapBindingStub object:

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

 

Assuming you have Yellowfin running on 8080 http port with SSL disabled, initializing Report service will be:

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 remoteReportCall() function of ReportServiceSoapBindingStub object:

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