Connecting to Repository Using Direct Transfer of Credentials

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.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<OpenMetabase xmlns="http://www.fsight.ru/PP.SOM.Som">
<tDef xmlns="">
  <id>WAREHOUSE</id>
  </tDef>
<tCreds xmlns="">
<user>
  <id>User</id>
  </user>
  <pass>Password</pass>
  </tCreds>
  <tArg xmlns="" />
  </OpenMetabase>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<OpenMetabaseResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <id xmlns="">NEJOFNHNBNFGGOAEGABOLMDNHJDHEPEEHIDONAKOKJMGBMEK!M</id>
  <sessKey xmlns="">394051</sessKey>
  <sessCookie xmlns="">C1</sessCookie>
  <version xmlns="">163</version>
  <defLocale xmlns="">1049</defLocale>
  <driver xmlns="">2</driver>
  </OpenMetabaseResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"OpenMetabase" :
{
"tDef" :
{
"id" : "WAREHOUSE"
},
"tCreds" :
{
"user" :
{
"id" : "User"
},
"pass" : "Password"
},
"tArg" : ""
}
}

JSON response:

{
"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:

OpenMetabase