Below is the example of using the OpenMetabase operation to connect to the repository. The request contains the user's credentials and the identifier of the description that contains settings for the repository connection. The response contains the repository connection moniker.
{ "OpenMetabase" : { "tDef" : { "id" : "PPREPOSITORY" }, "tCreds" : { "user" : { "id" : "pprepository" }, "pass" : "pprepository" }, "tArg" : "" } }
{ "OpenMetabaseResult" : { "id" : "S1!M", "sessKey" : "26916", "sessCookie" : "C1", "version" : "151" } }
The parameters required for connection are sent as input parameters of the function. The result of the operation is the result of the function.
public static OpenMetabaseResult MetabaseConnect(string mbDefinitionId, string userName, string password) { var somClient = new SomPortTypeClient(); //Proxy object for operation execution //Operation execution parameters var tOpen = new OpenMetabase() { tArg = new OpenMetabaseArg(), tCreds = new UserCreds() //User credentials used for connection { user = new UserId() //Repository user identifier { id = userName }, pass = password }, tDef = new MbDef() //Description of repository, to which connection is established { id = mbDefinitionId } }; //Repository connection var result = somClient.OpenMetabase(tOpen); return result; }
See also: