Show contents 

Web Service > Web Service Operations > Working with Cubes > OpenCube

OpenCube

Syntax

GetCubeResult OpenCube(OdId tOb, OpenCubeArg tArg)

Parameters

tOb. Moniker of the object that is a cube.

tArg. Parameters of cube opening.

Description

The OpenCube operation opens a repository cube and returns context for working with cube's structure.

Comments

The operation gets access to the structure and settings of various repository cubes. To execute the operation, in the tOb field specify moniker of the object that is a cube, and in the tArg field specify opening parameters. Object moniker can be obtained on executing the GetObjects operation. In the tArg.metaGet field specify the template that will be used to get cube metadata on opening. If the tArg.metaGet field is not set, the operation results in only the moniker of opened cube instance.

Further work with cube structure is executed using the GetCube and SetCube operations. To close the cube instance, use the CloseCube operation.

Example

Below is the example of opening cube structure for edit. The request contains moniker of the repository object that is a cube. The response contains moniker of opened cube instance.

The example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier example.

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">
<OpenCube xmlns="http://www.fsight.ru/PP.SOM.Som">
<tOb xmlns="">
  <id>DJIDPDNFAJIEGOAEFGBFAIAOIJBNELFEKJMNBFEFGMEEHCKG!M!5857</id>
  </tOb>
<tArg xmlns="">
<args>
  <bind>true</bind>
  <openForEdit>true</openForEdit>
  </args>
  </tArg>
  </OpenCube>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<OpenCubeResult 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="">
  <id>DJIDPDNFAJIEGOAEFGBFAIAOIJBNELFEKJMNBFEFGMEEHCKG!M!S!CJFAIFLNFAJIEGOAENFOLPMFKLFMJJPPEOLLHBIJJMKBKEMCM</id>
  </id>
  </OpenCubeResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"OpenCube" :
{
"tOb" :
{
"id" : "DJIDPDNFAJIEGOAEFGBFAIAOIJBNELFEKJMNBFEFGMEEHCKG!M!5857"
},
"tArg" :
{
"args" :
{
"bind" : "true",
"openForEdit" : "true"
}
}
}
}

JSON response:

{
"OpenCubeResult" :
{
"id" :
{
"id" : "DJIDPDNFAJIEGOAEFGBFAIAOIJBNELFEKJMNBFEFGMEEHCKG!M!S!CJFAIFLNFAJIEGOAENFOLPMFKLFMJJPPEOLLHBIJJMKBKEMCM"
}
}
}
public static GetCubeResult OpenCube(MbId mb, string cubeId)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tOpen = new OpenCube()
{
tArg = new OpenCubeArg()
{
args = new CubeOpenArgs()
{
bind = true,
openForEdit = true
}
},
tOb = new OdId() { id = mb.id + "!" + FindObjectById(mb, cubeId).k }
};
// Open cube
var tResult = somClient.OpenCube(tOpen);
return tResult;
}

See also:

Working with Cubes