Below is the example of using the OpenMetabase operation to connect to the repository. The request contains user credentials and repository description identifier. The response contains the repository connection moniker.
{
"OpenMetabase" :
{
"tDef" :
{
"id" : "WAREHOUSE"
},
"tCreds" :
{
"user" :
{
"id" : "User"
},
"pass" : "Password"
},
"tArg" : ""
}
}
{
"OpenMetabaseResult" :
{
"id" : "NEJOFNHNBNFGGOAEGABOLMDNHJDHEPEEHIDONAKOKJMGBMEK!M",
"sessKey" : "394051",
"sessCookie" : "C1",
"version" : "163",
"defLocale" : "1049",
"driver" : "2"
}
}
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() //Credentials used for connection
{
user = new UserId() //Repository user identifier
{
id = userName
},
pass = password
},
tDef = new MbDef() //Description of the repository, to which connection is established
{
id = mbDefinitionId
}
};
//Repository connection
var result = somClient.OpenMetabase(tOpen);
return result;
}
See also: