You will find an overview of the methods supplied under SOAP Web Service . In the following there are some examples of a web service client calls in the programming language C#.
Preparation
Authentication is carried out by means of an authentication string containing an authentication module and the login data to use. You must create an instance of the web service and the object for the login data to log in to the system. The login data is passed to following calls.
Example:
var svc = new Q1IMServiceSoapClient();
var login = new LoginInformation
{ AuthString = "Module=DialogUser;User=viadmin;Password=" };
Table 189: Examples of authentication
System users |
Module=DialogUser;User=<user name>;Password=<password> |
Employee |
Module=Person;User=<central user account>;Password=<password> |
Active Directory user account (role-based) |
Module=RoleBasedADSAccount |
Active Directory user account (manual input/role-based) |
Module=RoleBasedManualADS;User=<AD user name>;Password=<AD password> |
For detailed information about the One Identity Manager authentication modules, see the One Identity Manager Authorization and Authentication Guide.
GetListObject
This method returns an array of objects, which correspond to the given WHERE clause. The returned array contains the object's primary key and a [DISPLAY] special key, which contains the object's display value.
Example:
Q1IMService.KeyValuePair[][] objects = svc.GetListObject(login, "Person",
"FirstName like 'Hal%'");
GetListObjectWithDisplays
This method works in the same way as GetListObject and allows you to enter details of additional columns to be loaded.
Example:
In the example, the FirstName and LastName columns are available.
Q1IMService.KeyValuePair[][] objects = svc.GetListObjectWithDisplays(login, "Person",
"FirstName like 'Hal%'",
new [] {"FirstName", "LastName"});
GetCompleteSingleObject
All the properties of the object that is defined by the primary key are loaded by the method.
Example:
Q1IMService.KeyValuePair[] singleValues = svc.GetCompleteSingleObject(login,
"Person", "UID_Person", "746a5662-054b-4531-a889-1c135dad4c05");
GetSingleObject
Properties of a single object are loaded with this method.
Example:
In the example, the FirstName and LastName columns and the display value are loaded. The display value is given in the [DISPLAY] key.
Q1IMService.KeyValuePair[] values = svc.GetSingleObject(login, "Person",
"UID_Person", "746a5662-054b-4531-a889-1c135dad4c05",
new[] { "FirstName", "LastName" });
ChangeSingleObject
This method changes individual properties of an object.
Example:
In the example, the Description column of the employee with the corresponding UID_Person is modified.
var values = new[]
{
new Q1IMService.KeyValuePair
{
Key = "Description",
Value = "Created by webservice"
}
};
svc.ChangeSingleObject(login, "Person", "UID_Person",
"746a5662-054b-4531-a889-1c135dad4c05", values);
ChangeSingleObjectEx
Modifying an object with this method is done in the same way as with ChangeSingleObject, but here the primary key value is passed as a Key-Value-Pair-Array.
Example:
var values = new[]
{
new Q1IMService.KeyValuePair
{
Key = "Description",
Value = "Created by webservice"
}
};
var keys = new[]
{
new Q1IMService.KeyValuePair
{
Key = "UID_Person",
Value = "746a5662-054b-4531-a889-1c135dad4c05"
}
};
svc.ChangeSingleObjectEx(login, "Person", keys, values);
DeleteSingleObject
This method deletes an object.
Example:
In this example, the employee with the corresponding UID is deleted from the database.
svc.DeleteSingleObject(login, "Person",
"UID_Person", "746a5662-054b-4531-a889-1c135dad4c05");
DeleteSingleObjectEx
Using this method, you can delete objects with a multicolumn primary key (from example, from M:N tables).
Example:
svc.DeleteSingleObjectEx (
login,
"OrgHasApp",
new []
{
new Q1IMService.KeyValuePair { Key = "UID_Org", Value = <UID> },
new Q1IMService.KeyValuePair { Key = "UID_Application", Value = <UID>}
});
CreateSingleObject
A new object is created in the database with this object.
Example:
In this example, the employee "Jon Doe" is created.
var values = new[]
{
new Q1IMService.KeyValuePair {Key = "FirstName", Value = "John"},
new Q1IMService.KeyValuePair {Key = "LastName", Value = "Doe"}
};
svc.CreateSingleObject(login, "Person", values);
Exists
This method checks the existence of an object.
Example:
bool exists = svc.Exists(login, "Person",
"UID_Person", "746a5662-054b-4531-a889-1c135dad4c05");
GetSingleProperty
This method can be implemented to find a single property.
Example:
string description = svc.GetSingleProperty(login, "Person",
"UID_Person", "746a5662-054b-4531-a889-1c135dad4c05",
"Description");
InvokeCustomizer
The SOAP Web Service supports a InvokeCustomizer method, which calls a function for an object in the database. The first three parameters specify the object on which the method is called. The customizerName parameter provides the function name. An array of strings follows which contains the fully qualified name of the parameter data types. These are passed to the calling function. The following array of strings contains textual representation of the parameter.
How the function works
-
First, the database is opened and the object specified by objectType, pkName and pkValue is retrieved.
-
Then the runtime data types specified by parameterTypes are determined.
-
After that, text representations of the parameters are converted from the value array to the corresponding runtime data types.
-
The function is called with these values.
If the function to be called has no parameters, you can transfer the null value to the function for the parameterTypes and parameters parameters.
Example:
In this example, the method "TestMethod" is called for a Person type object with the primary key UID_Person and the given value. In this case, both parameters of System.String and System.Int32 type are transferred with the values "Foo" and "4711".
svc.InvokeCustomizer (login, "Person",
"UID_Person", "0000644F-C139-4B25-8D1C-5ECB93067E79",
"TestMethod",
new [] {"System.String", "System. Int32"},
new [] {"foo", "4711"});
InvokeDialogMethod
The method can call a dialog method on an object. Dialog methods do not have any parameters and no return values. The call is similar to the InvokeCustomizer call.
Example:
In this example, the "TestDialogMethod" method is called for a specific person. "TestDialogMethod" is the name of the corresponding to DialogMethod.MethodName method.
svc.InvokeDialogMethod (login,
"Person",
"UID_Person", "746a5662-054b-4531-a889-1c135dad4c05",
"TestDialogMethod");
FireGenEvent
A specific event is generated by this method. There is the option to enter other generating parameters.
public void FireGenEvent(
string objectType, string pkName, string pkValue,
strincolumng eventName, KeyValuePair[] parameters);
Example:
In this example, the "EXPORT_DATA" event is generated without additional parameters.
svc.FireGenEvent(login, "Person",
"UID_Person", "746a5662-054b-4531-a889-1c135dad4c05",
"EXPORT_DATA", new Q1IMService.KeyValuePair[] { });
CallFunction
This method calls a One Identity Manager script function.
Example:
In the example, the VI_BuildInitials script is called.
svc.CallFunction(login, "VI_BuildInitials",
new string [] {"John", "Doe"});