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.

...

Expand
titleUPDATEUSER

This call will edit a user’s details. It accepts AdministrationPerson as a parameter, which can be used to identify the user, by providing their ID (for example, their email address, or another type of ID depending on the Logon ID method).

The response will contain the AdministrationPerson object with the full details of the user.

Note: This call will not change the password of the user's account. To change the password, use the CHANGEPASSWORD function.

 

Request Elements

The following elements will be passed with this request:

Request Element

Data Type

Description

LoginId

String

User ID of the Yellowfin web services administrator who calls this web service. This can be the user ID or the email address, depending on the Logon ID method.

This Yellowfin account must have the “web services” role enabled, and must belong to the Default (i.e. Primary) Org.

Password

String

Password of the above account.

OrgId

Integer

Default (i.e. Primary) organization ID within Yellowfin. Always set this to 1.

Function

String

Web services function. Set this to "UPDATEUSER".

Person

AdministrationPerson

Object containing user details that need to be updated. See table below.

Anchor
updateuserap
updateuserap

Mandatory parameters to set in the AdministrationPerson object for this function:

AdministrationPerson Element

Data Type

Description

UserId

String

User ID to identify the user whose details are to be changed. This can be the user ID or the email address, depending on the Logon ID method.

You can provide any other parameters related to the user detail that needs to be updated. For example, a new FirstName to change their name, or Status to update their status, etc.

 

 

The following SOAP example shows the parameters that you can pass to this call. This example shows the user's status being changed to "Inactive":

Code Block
languagexml
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices.web.mi.hof.com/">
   <soapenv:Header/>
   <soapenv:Body>
      <web:remoteAdministrationCall>
         <arg0>
            <loginId>admin@yellowfin.com.au</loginId>
            <password>test</password>
            <orgId>1</orgId>
            <function>UPDATEUSER</function>
            <person>
            	<userId>binish.sheikh@yellowfin.com.au</userId>
            	<status>ACTIVE</status>
            </person>       
         </arg0>
      </web:remoteAdministrationCall>
   </soapenv:Body>
</soapenv:Envelope>

 

 

Reponse Elements

The response returned will contain these parameters:

Response Element

Data Type

Description

StatusCode

String

Status of the web service call. Possible values include:

  • SUCCESS
  • FAILURE

Person

AdministrationPerson

Object with the user details updated.

 

The service will return the below response, according to our SOAP example:

Code Block
languagexml
 <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:remoteAdministrationCallResponse xmlns:ns2="http://webservices.web.mi.hof.com/">
         <return>
            <errorCode>0</errorCode>
            <messages>Successfully Authenticated User: admin@yellowfin.com.au</messages>
            <messages>Getting user information...</messages>
            <messages>Getting user information...</messages>
            <messages>Web Service Request Complete</messages>
            <person>
               <emailAddress>binish.sheikh@yellowfin.com.au</emailAddress>
               <firstName>Binish</firstName>
               <ipId>13000</ipId>
               <lastName>Sheikh</lastName>
               <roleCode>YFADMIN</roleCode>
               <status>ACTIVE</status>
               <timeZoneCode>AUSTRALIA/BRISBANE</timeZoneCode>
               <userId>binish.sheikh@yellowfin.com.au</userId>
            </person>
            <sessionId>586e172a7c4850bb3edbaaf5264a312d</sessionId>
            <statusCode>SUCCESS</statusCode>
         </return>
      </ns2:remoteAdministrationCallResponse>
   </S:Body>
</S:Envelope>

 

 

Instructions

See below for step-by-step instructions on how to perform this call, using a Java example:

Expand
titleStep-by-step instructions
 
  • Here is what a basic request for this call will look like, which includes logging in as the admin user and specifying the web service call to perform:

    Code Block
    languagejava
    AdministrationServiceRequest rsr = new AdministrationServiceRequest();
    
    rsr.setLoginId("admin@yellowfin.com.au");
    rsr.setPassword("test");
    rsr.setOrgId(1);
    
    rsr.setFunction("UPDATEUSER");
    
  • Then use the AdministrationPerson object to identify the user whose details are to be updated:

    Code Block
    languagejava
    AdministrationPerson ap = new AdministrationPerson();
    
    ap.setUserId("john.smith@yellowfin.com.au");
  • Specify what detail is to be changed. For example, we can make a user account inactive:

    Code Block
    languagejava
    ap.setStatus("INACTIVE");               // This shows that the user "john.smith@yellowfin.com.au" will not be able to log in
    
    rsr.setPerson(ap);
    



  • Once the request is configured, perform the call:

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

    Initialize the Administration web service. Click here to learn how to do this.

 

  • This call's response will contain these parameters:

    Response Element

    Data Type

    Description

    StatusCode

    String

    Status of the web service call. Possible values include:

    • SUCCESS
    • FAILURE

    Person

    AdministrationPerson

    Object with the user details

 

Complete Example

Below is a complete example of the UPDATEUSER function. To use it for yourself, carry out the following the steps:

  1. Copy the code and save it as ws_updateuser.jsp.
  2. Put the file in the root folder: Yellowfin/appserver/webapps/ROOT.
  3. Adjust the host, port, admin user and user to update according to your environment.
  4. Run http://<host>:<port>/ws_updateuser.jsp from your Internet browser.

 

Code Block
languagejava
<%            
/*             ws_updateuser.jsp           */
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="com.hof.util.*, java.util.*, java.text.*" %> 
<%@ page import="com.hof.web.form.*" %>
<%@ page import="com.hof.mi.web.service.*" %>
<%
AdministrationServiceService s_adm = new AdministrationServiceServiceLocator("localhost",8080, "/services/AdministrationService", false);        // adjust host and port number

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

AdministrationServiceRequest rsr = new AdministrationServiceRequest();

rsr.setLoginId("admin@yellowfin.com.au");          // provide your Yellowfin web services admin account
rsr.setPassword("test");                           // change to the password of the above account
rsr.setOrgId(1);
rsr.setFunction("UPDATEUSER");


AdministrationPerson ap = new AdministrationPerson();
ap.setUserId("john.smith@yellowfin.com.au");
ap.setStutus("INACTIVE");
rsr.setPerson(ap);

AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
if ("SUCCESS".equals(rs.getStatusCode()) ) {
	ap = rs.getPerson();
	out.write("User Id: " + ap.getUserId() + "<br>");
	out.write("Password: " + ap.getPassword() + "<br>");
	out.write("First Name: " + ap.getFirstName() + "<br>");
	out.write("Last Name: " + ap.getLastName() + "<br>");
	out.write("Initial: " + ap.getInitial() + "<br>");
	out.write("Salutation Code: " + ap.getSalutationCode() + "<br>");
	out.write("Role Code: " + ap.getRoleCode() + "<br>");
	out.write("Email Address: " + ap.getEmailAddress() + "<br>");
	out.write("Language Code: " + ap.getLanguageCode() + "<br>");
	out.write("IpId: " + ap.getIpId() + "<br>");
	out.write("Time Zone Code: " + ap.getTimeZoneCode() + "<br>");
	out.write("Status: " + ap.getStatus() + "<br>");
} else {
	out.write("Failure");
	out.write(" Code: " + rs.getErrorCode() );
}
%>


 


 

Anchor
setavatarimg
setavatarimg

Expand
titleSETAVATARIMAGE

This web service is used to upload an avatar image for a specified user. The image should be an array of bytes in UTF-8 which you could convert to a String value.

 

Request Parameters

The following parameters should be passed with this request:

Request Element

Data Type

Description

LoginId

String

An admin account to connect to Yellowfin web services. This can be the user ID or the email address, depending on the Logon ID method.

This account must have the “web services” role enabled, and must belong to the default (i.e. primary) org.

Password

String

Password of the above account.

OrgId

Integer

Default (i.e. primary) organization ID within Yellowfin. Always set this to 1.

Function

String

Web service function. Set this to "SETAVATARIMAGE".

PersonAdministrationPersonThis object contains details of the user whose avatar is to be changed. See table below.
ParametersString[]An array containing a single element representing the avatar image to be uploaded. The image should be an array of bytes in UTF-8 format, which could be converted to a String.

Anchor
setavatarap
setavatarap

These are the main parameters that you must set in the AdministrationPerson object for this web service call:

AdministrationPerson Element

Data Type

Description

IpId

Integer

Provide the internal Yellowfin IP ID of the user. This value is stored in the Person parameter's IpId field in Yellowfin's database.

 

 

Request Example

Below is a SOAP XML example for this request:

Code Block
languagexml
themeConfluence
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices.web.mi.hof.com/">
   <soapenv:Header/>
   <soapenv:Body>
      <web:remoteAdministrationCall>
     	<arg0>
            <loginId>admin@yellowfin.com.au</loginId>
        	<password>test</password>
            <orgId>1</orgId>     	
            <function>SETAVATARIMAGE</function>
            <person>
        	  	<ipId>5</ipId>
            </person>           
            <parameters>
               <string>iVBORw0KGgoAAAANSUhEUgAAAdsAAA ... your image string</string>
            </parameters>
         </arg0>
      </web:remoteAdministrationCall>
   </soapenv:Body>
</soapenv:Envelope>

 

 

Response Parameters

The returned response will contain the following parameter:

Response Element

Data Type

Description

StatusCode

String

Status of the web service call. Possible values include:

  • SUCCESS
  • FAILURE

 

 

Response Example

The service will return the below response, according to our SOAP example:

Code Block
languagexml
themeConfluence
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:remoteAdministrationCallResponse xmlns:ns2="http://webservices.web.mi.hof.com/">
         <return>
            <errorCode>0</errorCode>
            <messages>Successfully Authenticated User: admin@yellowfin.com.au</messages>
            <messages>Web Service Request Complete</messages>
            <sessionId>5fbbf0f2d8a6f4902adde5bfb659fed7</sessionId>
            <statusCode>SUCCESS</statusCode>
         </return>
      </ns2:remoteAdministrationCallResponse>
   </S:Body>
</S:Envelope>

 

 

Instructions

See below for step-by-step instructions on how to perform this call, using a Java example:

Expand
titleStep-by-step instructions
  • Start with a basic request for this function, which includes logging in as the admin user and specifying the web service call to perform:

    Code Block
    languagejava
    AdministrationServiceRequest rsr = new AdministrationServiceRequest();
    
    rsr.setLoginId("admin@yellowfin.com.au");
    rsr.setPassword("test");
    rsr.setOrgId(1);
    
    rsr.setFunction("SETAVATARIMAGE");
  • You can specify the user by providing their IP ID:

    Code Block
    languagejava
    AdministrationPerson ap = new AdministrationPerson();
    ap.setIpId(5);
    
    rsr.setPerson(ap); 



  • Select the image file, by using the java.nio.file library:

    Code Block
    languagejava
    Path path = Paths.get("D:/TMP/fish.jpg"); // existing image file
    byte[] data = Files.readAllBytes(path);
    byte[] encodeBase64 = java.util.Base64.getEncoder().encode(data);
    String img = new String(encodeBase64, "UTF-8");
    
    rsr.setParameters(new String[] {img});



  • Once the request is configured, perform the call:

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

    Initialize the Administration web service. Click here to learn how to do this. 

 

  • The response will contain a StatusCode element.

     

 

 

Complete Example

Below is a full example of this web service call. To use it for yourself, carry out the following the steps:

  1. Copy the code and save it as ws_ setavatarimage.jsp.
  2. Put the file in the root folder: Yellowfin/appserver/webapps/ROOT.
  3. Adjust the host, port, and admin user according to your environment.
  4. Run http://<host>:<port>/ws_ setavatarimage.jsp from your Internet browser.

 

Code Block
languagejava
themeEclipse
<%        	
/*          	ws_setavatarimage.jsp                              	*/
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="com.hof.util.*, java.util.*, java.text.*" %>
<%@ page import="com.hof.web.form.*" %>
<%@ page import="com.hof.mi.web.service.*" %>
<%@ page import="java.nio.file.Files" %>
<%@ page import="java.nio.file.Paths" %>
<%@ page import="java.nio.file.Path" %>
<%
AdministrationServiceService s_adm = new AdministrationServiceServiceLocator("localhost",8080, "/services/AdministrationService", false);    	// adjust host and port number
AdministrationServiceSoapBindingStub adminService = (AdministrationServiceSoapBindingStub) s_adm.getAdministrationService();
AdministrationServiceRequest rsr = new AdministrationServiceRequest();
 
rsr.setLoginId("admin@yellowfin.com.au");      				// provide your Yellowfin web services admin account
rsr.setPassword("test");                                    // change to the password of the above account
rsr.setOrgId(1);
rsr.setFunction("SETAVATARIMAGE");
 
AdministrationPerson ap = new AdministrationPerson();
ap.setIpId(5);
 
rsr.setPerson(ap);
 
Path path = Paths.get("D:/TMP/fish.jpg"); // existing image file
byte[] data = Files.readAllBytes(path);
byte[] encodeBase64 = java.util.Base64.getEncoder().encode(data);
String img = new String(encodeBase64, "UTF-8");
 
rsr.setParameters(new String[] {img});
 
AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);
 
if ("SUCCESS".equals(rs.getStatusCode()) ) {
              	out.write("<br>Success");
} else {
              	out.write("Failure");
              	out.write(" Code: " + rs.getErrorCode());
}
%>

 


 

 

User Session Termination

...

Expand
titleLOGOUTUSER

This service terminates a Yellowfin session. However, it requires the LoginSessionId to be able to log the user out. This is is enough to identify the user, hence the user ID is not required. When a single sign-on is performed with either the LOGINUSER or LOGINUSERNOPASSWORD functions, you can get the LoginSessionId via:

Code Block
languagejava
String token = response.getLoginSessionId();

 

Save this value, so that you can pass it out to the LOGOUTUSER request later:

Code Block
languagejava
request.setLoginSessionId(token);

 

Request Elements

The following elements will be passed with this request:

Request Element

Data Type

Description

LoginId

String

Yellowfin web services admin user Id. This can be the user ID or the email address, depending on the Logon ID method.

This Yellowfin account must have the “web services” role enabled, and must belong to the Default (i.e. Primary) Org.

Password

String

Password of the above account.

OrgId

Integer

Default (i.e. Primary) organization ID within Yellowfin. Always set this to 1.

Function

String

Web services function. Set this to "LOGOUTUSER".

Person AdministrationPersonThis object will contain the details of the use who is to be logged out. See the table below
LoginSessionIdStringSession token of the Yellowfin instance that needs to be terminated. This is enough to identify the user.

Anchor
logoutap
logoutap

Mandatory parameters to set in the AdministrationPerson object for this function:

AdministrationPerson Element

Data Type

Description

UserId

String

User ID to identify the user whose details are to be changed. This can be the user ID or the email address, depending on the Logon ID method.

PasswordStringPassword of the above account.

 

The following SOAP XML example shows the request for this function using the above parameters:

Code Block
languagexml
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices.web.mi.hof.com/">
   <soapenv:Header/>
   <soapenv:Body>
      <web:remoteAdministrationCall>
         <arg0>
            <loginId>admin@yellowfin.com.au</loginId>
            <password>test</password>
            <orgId>1</orgId>
            <function>LOGOUTUSER</function>
            <person>            
               <userId>admin@yellowfin.com.au</userId>
               <password>test</password>
            </person>
            <loginSessionId>39fb11047affb98c9d081fb48bed0093</loginSessionId>
         </arg0>
      </web:remoteAdministrationCall>
   </soapenv:Body>
</soapenv:Envelope>

 

 

Reponse Elements

The response returned will contain these parameters:

Response Element

Data Type

Description

StatusCode

String

Status of the web service call. Possible values include:

  • SUCCESS
  • FAILURE

 

Here is the resposnse of the above SOAP XML call:

Code Block
languagexml
 <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:remoteAdministrationCallResponse xmlns:ns2="http://webservices.web.mi.hof.com/">
         <return>
            <errorCode>0</errorCode>
            <messages>Successfully Authenticated User: admin@yellowfin.com.au</messages>
            <messages>Web Service Request Complete</messages>
            <sessionId>9cad6c76734e329c298e7b15c57a19db</sessionId>
            <statusCode>SUCCESS</statusCode>
         </return>
      </ns2:remoteAdministrationCallResponse>
   </S:Body>
</S:Envelope>


 

Instructions

See below for step-by-step instructions on how to perform this call, using a Java example:

Expand
titleStep-by-step instructions
 
  • Here is a basic request for this call, which includes logging in as the admin user and specifying the web service call to perform:

    Code Block
    languagejava
    AdministrationServiceRequest rsr = new AdministrationServiceRequest();
    
    rsr.setLoginId("admin@yellowfin.com.au");
    rsr.setPassword("test");
    rsr.setOrgId(1);
    
    rsr.setFunction("LOGOUTUSER");
  • Pass the login session ID:

    Code Block
    languagejava
    rsr.setLoginSessionId(token);
    
  • If the user is logged into multiple Tomcat sessions simultaneously, then you can even specify which session to terminate by setting a parameter, for example:

    Code Block
    languagejava
    String[] _sessionId = new String[]{sessionId}; // log out by Tomcat session Id (cookies JSESSIONID)
    rsr.setParameters(_sessionId);

    Only one session should be provided for termination per request. Note that the Tomcat session ID is optional; if omitted, Yellowfin will terminate all of the user's sessions.

  • Once the request is configured, perform the call:

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

    Initialize the Administration web service. Click here to learn how to do this.

 

  • This call's response will contain these parameters:

    Response Element

    Data Type

    Description

    StatusCode

    String

    Status of the web service call. Possible values include:

    • SUCCESS
    • FAILURE

 

 

Complete Example

Below is a complete example of the LOGOUTUSER function. This script is designed to perform the following steps:

  • Call the LOGINUSER service which retrieves the LoginSessionId;
  • Configures the login link. You will need to click this link first, to initialize a Yellowfin session for the specifed user. (In our example we will log in the user john.smith@yellowfin.com.au. Make sure that the user you mention, already exists in your Yellowfin instance, or you can even modify the userId.)
  • Configure the link to log out. You will need to click this once the session has started.

 

To use this script for yourself, carry out the following the steps:

  1. Copy the code and save it as test.jsp.
  2. Put the file in the root folder: Yellowfin/appserver/webapps/ROOT.
  3. Adjust the host, port, admin user and user to login/logout according to your environment.
  4. Run http://<host>:<port>/test.jsp from your Internet browser.

 

Code Block
languagejava
<%            
/*              test.jsp                */
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="com.hof.util.*, java.util.*, java.text.*" %> 
<%@ page import="com.hof.web.form.*" %>
<%@ page import="com.hof.mi.web.service.*" %>
<% 
AdministrationServiceService s_adm = new AdministrationServiceServiceLocator("localhost",8080, "/services/AdministrationService", false);        // adjust host and port number
AdministrationServiceSoapBindingStub adminService = (AdministrationServiceSoapBindingStub) s_adm.getAdministrationService();
AdministrationServiceRequest rsr = new AdministrationServiceRequest();

String token = request.getParameter("token");

if (token == null) {
	
	//login the admin user:

	rsr.setLoginId("admin@yellowfin.com.au");          // provide your Yellowfin web services admin account
	rsr.setPassword("test");                           // change to the password of the above account
	rsr.setOrgId(1);
	rsr.setFunction("LOGINUSER");

	AdministrationPerson ap = new AdministrationPerson();

	String userId = "john.smith@yellowfin.com.au";

	ap.setUserId(userId);
	ap.setPassword("test");

	rsr.setPerson(ap);

	AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);

	if ("SUCCESS".equals(rs.getStatusCode()) ) {
		String token_ = rs.getLoginSessionId();
		out.write("Login by opening the link in a new subtab prior to Logout. The tomcat session must be initialized...");
		out.write("<BR>Login: <A href='http://localhost:8080/logon.i4?LoginWebserviceId=" + token_ + "'>");
		out.write("http://localhost:8080/logon.i4?LoginWebserviceId=" + token_ + "</a><br>");
		out.write("<BR>Logout: <A href='http://localhost:8080/test.jsp?token=" + token_ + "&userId=" + userId + "'>");
		out.write("http://localhost:8080/test.jsp?token=" + token_ + "&userId=" + userId + "</a><br>");
	} else {
		out.write("Failure");
		out.write(" Code: " + rs.getErrorCode() );
		return;
	}
} else {

	//logout the user:

	out.write("Trying to logout " + token + " session...<br>");

	rsr = new AdministrationServiceRequest();

	rsr.setLoginId("admin@yellowfin.com.au");          // provide your Yellowfin web services admin account
	rsr.setPassword("test");                           // set the password of the above account
	rsr.setOrgId(1);

	rsr.setFunction("LOGOUTUSER");

	rsr.setLoginSessionId(token);

	AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);

	if ("SUCCESS".equals(rs.getStatusCode()) ) {
		out.write("Logout: Success");
	} else {
		out.write("Failure");
		out.write("Code: " + rs.getErrorCode() );
	}
} 
%>


 


 

...

Expand
titleLOGOUTBYUSERID

This service is similar to the LOGOUTUSER function in that it logs out a specified user, however this one requires either a user ID (for example, an email address or any other type of ID depending on the Login ID method) or a user IpID (that is, the value of the IpId field in the Person table in Yellowfin's database), rather than a login session ID to identify the user.

This call uses the AdministrationPerson object which is used to provide the user ID or IpId.

 

Request Elements

The following elements will be passed with this request:

Request Element

Data Type

Description

LoginId

String

Yellowfin web services admin user Id. This can be the user ID or the email address, depending on the Logon ID method.

This Yellowfin account must have the “web services” role enabled, and must belong to the Default (i.e. Primary) Org.

Password

String

Password of the above account.

OrgId

Integer

Default (i.e. Primary) organization ID within Yellowfin. Always set this to 1.

Function

String

Web services function. Set this to "LOGOUTBYUSERID".

Person

AdministrationPerson

Object containing details of the user to log out. See table below.

 

Anchor
logoutuserap
logoutuserap

Set either one of these parameters in the AdministrationPerson object:

AdministrationPerson Element

Data Type

Description

UserId

String

User ID to identify the user to terminate their Yellowfin session. This can be the user ID or the email address, depending on the Logon ID method.

IpIdStringIp ID of the user whose session is to be terminated.

 

The following XML SOAP example shows a request for this function being passed:

Code Block
languagexml
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://webservices.web.mi.hof.com/">
   <soapenv:Header/>
   <soapenv:Body>
     <web:remoteAdministrationCall>
         <arg0>
            <loginId>admin@yellowfin.com.au</loginId>
            <password>test</password>
            <orgId>1</orgId>
            <function>LOGOUTBYUSERID</function>
            <person>            
               <userId>admin@yellowfin.com.au</userId>
               <password>test</password>
            </person>
         </arg0>
      </web:remoteAdministrationCall>
   </soapenv:Body>
</soapenv:Envelope>

 

 

Reponse Elements

The response returned will contain these parameters:

Response Element

Data Type

Description

StatusCode

String

Status of the web service call. Possible values include:

  • SUCCESS
  • FAILURE

 

The response of our above SOAP example is shown below:

Code Block
languagexml
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
   <S:Body>
      <ns2:remoteAdministrationCallResponse xmlns:ns2="http://webservices.web.mi.hof.com/">
         <return>
            <errorCode>0</errorCode>
            <messages>Successfully Authenticated User: admin@yellowfin.com.au</messages>
            <messages>Web Service Request Complete</messages>
            <sessionId>f8a04d7c9530ff18f65f95048e6a4500</sessionId>
            <statusCode>SUCCESS</statusCode>
         </return>
      </ns2:remoteAdministrationCallResponse>
   </S:Body>
</S:Envelope>

 

 

Instructions

See below for step-by-step instructions on how to perform this call, using a Java example:

Expand
titleStep-by-step instructions
  • Here is a basic request for this call, which includes logging in as the admin user and specifying the web service call to perform:

    Code Block
    languagejava
    AdministrationServiceRequest rsr = new AdministrationServiceRequest();
    
    rsr.setLoginId("admin@yellowfin.com.au");
    rsr.setPassword("test");
    rsr.setOrgId(1);
    
    rsr.setFunction("LOGOUTBYUSERID");
  • Identify the user to log out, by passing their user ID or IpId:

    Code Block
    languagejava
    AdministrationPerson ap = new AdministrationPerson();
    ap.setUserId(userId); 
          
    rsr.setPerson(ap);
    
  • If the user is logged into multiple Tomcat sessions simultaneously, then you can specify which session to terminate by setting a parameter, for example:

    Code Block
    languagejava
    String[] _sessionId = new String[]{sessionId}; // log out by Tomcat session Id (cookies JSESSIONID)
    rsr.setParameters(_sessionId);

    Only one session should be provided for termination per request. Note that the Tomcat session ID is optional; if omitted, Yellowfin will terminate all of the user's sessions.

  • Once the request is configured, perform the call:

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

    Initialize the Administration web service. Click here to learn how to do this.

 

  • This call's response will contain these parameters:

    Response Element

    Data Type

    Description

    StatusCode

    String

    Status of the web service call. Possible values include:

    • SUCCESS
    • FAILURE

     

     

 

 

Complete Example

Below is a complete example of the LOGOUTUSER function. This script is designed to perform the following steps:

  • Configures the login link. You will need to click this link first, to initialize a Yellowfin session for the specifed user. (In our example we will log in the user john.smith@yellowfin.com.au. Make sure that the user you mention, already exists in your Yellowfin instance, or you can even modify the userId.)
  • Configure the link to log out. You will need to click this once the session is set up.

 

To use this script for yourself, carry out the following the steps:

  1. Copy the code and save it as test.jsp.
  2. Put the file in the root folder: Yellowfin/appserver/webapps/ROOT.
  3. Adjust the host, port, admin user and user to login/logout according to your environment.
  4. Run http://<host>:<port>/test.jsp from your Internet browser.

 

Code Block
languagejava
<%            
/*              test.jsp                */
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="com.hof.util.*, java.util.*, java.text.*" %> 
<%@ page import="com.hof.web.form.*" %>
<%@ page import="com.hof.mi.web.service.*" %>
<% 
AdministrationServiceService s_adm = new AdministrationServiceServiceLocator("localhost",8080, "/services/AdministrationService", false);        // adjust host and port number

AdministrationServiceSoapBindingStub adminService = (AdministrationServiceSoapBindingStub) s_adm.getAdministrationService();
AdministrationServiceRequest rsr = new AdministrationServiceRequest();


String userId = request.getParameter("userId");

if (userId == null) {

	//login the admin user:

	rsr.setLoginId("admin@yellowfin.com.au");          // provide your Yellowfin web services admin account
	rsr.setPassword("test");                           // set the password of the above account
	rsr.setOrgId(1);
	rsr.setFunction("LOGINUSER");


	AdministrationPerson ap = new AdministrationPerson();

	userId = "john.smith@yellowfin.com.au";

	ap.setUserId(userId);
	ap.setPassword("test");


	rsr.setPerson(ap);
	
	AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);


	if ("SUCCESS".equals(rs.getStatusCode()) ) {
		String token_ = rs.getLoginSessionId();
		out.write("Login by opening the link in a new subtab prior to Logout. The tomcat session must be initialized...");
		out.write("<BR>Login: <A href='http://localhost:8080/logon.i4?LoginWebserviceId=" + token_ + "'>");
		out.write("http://localhost:8080/logon.i4?LoginWebserviceId=" + token_ + "</a><br>");

		out.write("<BR>Logout: <A href='http://localhost:8080/test.jsp?token=" + token_ + "&userId=" + userId + "'>");
		out.write("http://localhost:8080/test.jsp?token=" + token_ + "&userId=" + userId + "</a><br>");

	}else {
		out.write("Failure");
		out.write(" Code: " + rs.getErrorCode() );
		return;
	}
} else {

	//logout the user:
	
	out.write("Trying to logout " + userId + " session...<br>");

	rsr = new AdministrationServiceRequest();

	rsr.setLoginId("admin@yellowfin.com.au");          // provide your Yellowfin web services admin account
	rsr.setPassword("test");                           // change to the password of the above account
	rsr.setOrgId(1);
	
	rsr.setFunction("LOGOUTBYUSERID");

	AdministrationPerson ap = new AdministrationPerson();
	ap.setUserId(userId);
	
	rsr.setPerson(ap);

	AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);


	if ("SUCCESS".equals(rs.getStatusCode()) ) {
		out.write("Logout: Success");
	} else {
		out.write("Failure");
		out.write(" Code: " + rs.getErrorCode() );
	}
} 
%>



 

 

...