Show contents 

Web Service > Working with Web Service > Connecting to Web Service > Using Guest Connection

Using Guest Connection

Any introductory work with web service can be organized via a guest connection. To provide work of such connection, one should first save user credentials in the BI server registry that will be used for authorization. To do this, as an administrator start the PP.Util utility with the /save_creds <repository id> /gc <user name> parameters. Enter the password and press the ENTER key to finish saving of credentials.

After the credentials are saved, a guest connection can be created in two ways:

  1. Use fixed moniker in operations. The fixed moniker is based on the repository description identifier and has the following format: <repository description id>!Guest!M. On the first execution of any operation with this moniker a guest connection is created on the BI server. Use this moniker as a prefix to execute other operations.

  2. Create a guest connection using the OpenMetabase operation. To execute the operation, in the tDef.id field specify repository description identifier, in user credentials in the tCreds.useGuestCreds field specify the true value, and in the tCreds.pass mandatory field specify empty value. After executing the operation a guest connection is created, and a moniker for further work is returned.

Working via a guest connection enables the user to execute operations for the objects, for which the saved user has access permissions. To close the guest connection, use the CloseMetabase operation.

Example

The example of getting information about guest connection. If guest connection has not been created yet, it will be created automatically on executing the GetSystemInfo operation.

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">
<GetSystemInfo xmlns="http://www.fsight.ru/PP.SOM.Som">
<tArg xmlns="">
<metabase>
  <id>WAREHOUSE!Guest!M</id>
  </metabase>
  </tArg>
  </GetSystemInfo>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<GetSystemInfoResult 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">
  <version xmlns="">Release 10.6.10067.0 Master x64</version>
  <release xmlns="">10.6</release>
  <platformInfo xmlns="">x64</platformInfo>
  <osType xmlns="">Windows</osType>
  <osInfo xmlns="">Windows 10 x64</osInfo>
  <metabaseSessionTimeout xmlns="">00:30:00.000</metabaseSessionTimeout>
  <metabaseStoreBinaryCount xmlns="">0</metabaseStoreBinaryCount>
  <metabaseLocale xmlns="">1049</metabaseLocale>
  <metabaseConnectionPoolMaxCount xmlns="">50</metabaseConnectionPoolMaxCount>
  </GetSystemInfoResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"GetSystemInfo" :
{
"tArg" :
{
"metabase" :
{
"id" : "WAREHOUSE!Guest!M"
}
}
}
}

JSON response:

{
"GetSystemInfoResult" :
{
"version" : "Release 10.6.10067.0 Master x64",
"release" : "10.6",
"platformInfo" : "x64",
"osType" : "Windows",
"osInfo" : "Windows 10 x64",
"metabaseSessionTimeout" : "00:30:00.000",
"metabaseStoreBinaryCount" : "0",
"metabaseLocale" : "1049",
"metabaseConnectionPoolMaxCount" : "50"
}
}
public static GetSystemInfoResult SimpleGuestConnect(string mbDefinitionId)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tGet = new GetSystemInfo()
{
tArg = new GetSystemInfoArg()
{
metabase = new MbId() { id = mbDefinitionId + "!Guest!M" }
}
};
// Get web service information
var result = somClient.GetSystemInfo(tGet);
return result;
}

The example of creating a connection using the OpenMetabase operation:

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="">
  <pass />
  <useGuestCreds>true</useGuestCreds>
  </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="">ABMDEDIPOAODGOAEILNHAJACNGILILPEMLBKDENDDGHECHAJ!M</id>
  <sessKey xmlns="">339878</sessKey>
  <sessCookie xmlns="">C2</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" :
{
"pass" : "",
"useGuestCreds" : "true"
},
"tArg" : ""
}
}

JSON response:

{
"OpenMetabaseResult" :
{
"id" : "ABMDEDIPOAODGOAEILNHAJACNGILILPEMLBKDENDDGHECHAJ!M",
"sessKey" : "339878",
"sessCookie" : "C2",
"version" : "163",
"defLocale" : "1049",
"driver" : "2"
}
}
public static OpenMetabaseResult GuestConnectByOpenMetabase(string mbDefinitionId)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tOpen = new OpenMetabase()
{
tArg = new OpenMetabaseArg(),
tCreds = new UserCreds()
{
useGuestCreds = true, // Indicates whether guest login is used
pass = string.Empty // Empty password because the field is mandatory
},
tDef = new MbDef()
{
id = mbDefinitionId // Identifier of repository description, to which connection is established
}
};
// Create a guest connection
var result = somClient.OpenMetabase(tOpen);
return result;
}

See also:

Connecting to Web Service | Setting Up Guest Login