Getting Information about Dictionary Structure

Below is the example of using the GetDimMetadata operation to get information about structure of repository dictionary. The request contains the dictionary moniker and the pattern that determines what data must be obtained. The response contains the obtained information.

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">
<GetDimMetadata xmlns="http://www.fsight.ru/PP.SOM.Som">
<tDim xmlns="">
  <id>S1!M!S!S1</id>
  </tDim>
<tArg xmlns="">
<pattern>
  <obInst>false</obInst>
  <getDescr>true</getDescr>
  <getAttrs>true</getAttrs>
  <getLevs>true</getLevs>
  <getCompound>true</getCompound>
  </pattern>
  </tArg>
  </GetDimMetadata>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<GetDimMetadataResult 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>S1!M!S!S1</id>
  </id>
<data xmlns="">
<descr>
  <k>116</k>
  <id>DIM_1</id>
  <n>Dim_1</n>
  <vis>1</vis>
<cls>
  <k>1025</k>
  </cls>
  </descr>
<attrs>
<it>
  <k>117</k>
  <id>NAME</id>
  <n>Name</n>
  <vis>1</vis>
  <dt>1</dt>
  <predefined>Name</predefined>
  <dataDomain>0</dataDomain>
  <nullable>1</nullable>
  <hasHierarchy>0</hasHierarchy>
  </it>
<it>
  <k>118</k>
  <id>ID</id>
  <n>Identifier</n>
  <vis>1</vis>
  <dt>2</dt>
  <uniqueIndex>INDEX1</uniqueIndex>
  <predefined>Ident</predefined>
  <dataDomain>0</dataDomain>
  <nullable>1</nullable>
  <hasHierarchy>0</hasHierarchy>
  </it>
<it>
  <k>119</k>
  <id>ORDER</id>
  <n>Order</n>
  <vis>1</vis>
  <dt>2</dt>
  <predefined>Order</predefined>
  <dataDomain>0</dataDomain>
  <nullable>1</nullable>
  <hasHierarchy>0</hasHierarchy>
  </it>
<it>
  <k>122</k>
  <id>PARENT</id>
  <n>Parent</n>
  <vis>1</vis>
  <dt>2</dt>
  <dataDomain>0</dataDomain>
  <nullable>1</nullable>
  <hasHierarchy>0</hasHierarchy>
  </it>
<it>
  <k>177</k>
  <id>CODE</id>
  <n>Code</n>
  <vis>1</vis>
  <dt>1</dt>
  <dataDomain>0</dataDomain>
  <nullable>1</nullable>
  <hasHierarchy>0</hasHierarchy>
  </it>
  <ident>1</ident>
  <name>0</name>
  <order>2</order>
  </attrs>
<levs>
<it>
  <k>150</k>
  <id>LEVEL1</id>
  <n>Level 1</n>
  <vis>1</vis>
  </it>
<it>
  <k>151</k>
  <id>LEVEL2</id>
  <n>Level 2</n>
  <vis>1</vis>
  </it>
<it>
  <k>152</k>
  <n>Level 2</n>
  <vis>0</vis>
  </it>
  </levs>
<selection>
  <selectedCount>-1</selectedCount>
<compound>
  <k>4294967295</k>
  </compound>
  </selection>
  <isAbacSecured>0</isAbacSecured>
  </data>
  </GetDimMetadataResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"GetDimMetadata" :
{
"tDim" :
{
"id" : "S1!M!S!S1"
},
"tArg" :
{
"pattern" :
{
"obInst" : "false",
"getDescr" : "true",
"getAttrs" : "true",
"getLevs" : "true",
"getCompound" : "true"
}
}
}
}

JSON response:

{
"GetDimMetadataResult" :
{
"id" :
{
"id" : "S1!M!S!S1"
},
"data" :
{
"descr" :
{
"k" : "116",
"id" : "DIM_1",
"n" : "Dim_1",
"vis" : "1",
"cls" :
{
"k" : "1025"
}
},
"attrs" :
{
"it" :
[
{
"k" : "117",
"id" : "NAME",
"n" : "Name",
"vis" : "1",
"dt" : "1",
"predefined" : "Name",
"dataDomain" : "0",
"nullable" : "1",
"hasHierarchy" : "0"
},
{
"k" : "118",
"id" : "ID",
"n" : "Identifier",
"vis" : "1",
"dt" : "2",
"uniqueIndex" : "INDEX1",
"predefined" : "Ident",
"dataDomain" : "0",
"nullable" : "1",
"hasHierarchy" : "0"
},
{
"k" : "119",
"id" : "ORDER",
"n" : "Order",
"vis" : "1",
"dt" : "2",
"predefined" : "Order",
"dataDomain" : "0",
"nullable" : "1",
"hasHierarchy" : "0"
},
{
"k" : "122",
"id" : "PARENT",
"n" : "Parent",
"vis" : "1",
"dt" : "2",
"dataDomain" : "0",
"nullable" : "1",
"hasHierarchy" : "0"
},
{
"k" : "177",
"id" : "CODE",
"n" : "Code",
"vis" : "1",
"dt" : "1",
"dataDomain" : "0",
"nullable" : "1",
"hasHierarchy" : "0"
}
],
"ident" : "1",
"name" : "0",
"order" : "2"
},
"levs" :
{
"it" :
[
{
"k" : "150",
"id" : "LEVEL1",
"n" : "Level 1",
"vis" : "1"
},
{
"k" : "151",
"id" : "LEVEL2",
"n" : "Level 2",
"vis" : "1"
},
{
"k" : "152",
"n" : "Level 2",
"vis" : "0"
}
]
},
"selection" :
{
"selectedCount" : "-1",
"compound" :
{
"k" : "4294967295"
}
},
"isAbacSecured" : "0"
}
}
}
public static GetDimMetadataResult GetDictInfo(DmId moniker)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tMeta = new GetDimMetadata()
{
tArg = new GetDimMetadataArg()
{
pattern = new DmMetadataPattern()
{
getAttrs = true,
getIndexes = true,
getLevs = true,
getCompound = true,
getDescr = true,
obInst = false
}
},
tDim = moniker
};
//Get information about dictionary structure
var result = somClient.GetDimMetadata(tMeta);
return result;
}

See also:

GetDimMetadata: Operation