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
titleGETALLUSERS

This functions retrieves details of all the users in a specified client organization. The information is retrieved in an array of AdministrationPerson objects. If a client organization is not specified, then all the users will be retrieved. You can use the setParameters() method to specify a searching criteria for users being retrieved. For security reasons, passwords will not be returned and will be NULL.


Request Elements

The following elements will be passed with this request:

Request Element

Data Type

Description

LoginId

String

The ID of a web services admin user who logs in to perform this function. 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 "GETUSER".

Client

AdministrationClientOrg

(Optional.) Setting the required properties on this object specifies a Client Org to be searched; otherwise, all the client organizations will get be searched if not passed. See table below.


AdministrationClientOrg Element

Data Type

Description

ClientReferenceID

String

Client Org Internal Reference Id to be searched.

Request Example

The following SOAP example shows the parameters that you can pass to this call:

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>GETALLUSERS</function>
         </arg0>
      </web:remoteAdministrationCall>
   </soapenv:Body>
</soapenv:Envelope>


Response 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

People

AdministrationPerson[]

Array of objects with the users’ details.


Response Example

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>Web Service Request Complete</messages>
            <people>
               <firstName>System</firstName>
               <ipId>5</ipId>
               <lastName>Administrator</lastName>
               <userId>admin@yellowfin.com.au</userId>
            </people>
            <sessionId>2c32528279baa26b730f9e3c8787880d</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's an example of a request to retrieve all users, which includes logging in as the admin user:

    Code Block
    languagejava
    AdministrationServiceRequest rsr = new AdministrationServiceRequest();
    
    rsr.setLoginId("admin@yellowfin.com.au");
    rsr.setPassword("test");
    rsr.setOrgId(1);
    



  • Specify a client organization, otherwise all the client organizations will get searched:

    Code Block
    languagejava
    AdministrationClientOrg client = new AdministrationClientOrg();
    client.setClientReferenceId("org1");
    rsr.setClient(client);
    



  • Call the function:

    Code Block
    languagejava
    rsr.setFunction("GETALLUSERS");
    



  • Searching Criteria: The GETALLUSERS function accepts an array of two strings. The first string (searchingCriteria[0]) will be compared with Yellowfin database users’ first names, last names, email left or email right, using the condition LIKE ‘%John%’. The second string (searchingCriteria[1]) will be compared with email right (domain) of the Yellowfin database users.

    Code Block
    languagexml
    String[] searchingCriteria = new String[] {"John","yellowfin.com.au"};
    rsr.setParameters(searchingCriteria);



  • 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 the StatusCode and People parameters. See the Response Parameters table above for more details.


Complete Example

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

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


Code Block
languagejava
<%            
/*              ws_getallusers.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");
rsr.setPassword("test");
rsr.setOrgId(1);

AdministrationClientOrg client = new AdministrationClientOrg();
client.setClientReferenceId("org1");
rsr.setClient(client);

rsr.setFunction("GETALLUSERS");

String[] searchingCriteria = new String[] {"John","yellowfin.com.au"};
rsr.setParameters(searchingCriteria);

AdministrationServiceResponse rs = adminService.remoteAdministrationCall(rsr);

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




...