Selecting Elements Before Getting Information

Below is the example of using the GetDimElements operation to select elements and to get basic information about these elements. The request contains moniker of opened dictionary instance. The response contains basic information about the elements that includes element's key, name, level and availability of child elements, as well as summary information about elements selection.

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">
<GetDimElements xmlns="http://www.fsight.ru/PP.SOM.Som">
<tDim xmlns="">
  <id>S1!M!S!S1</id>
  </tDim>
<tArg xmlns="">
  <selectionInfo>true</selectionInfo>
<changeSelection>
  <elSelectOp>Select</elSelectOp>
  <elRelative>All</elRelative>
  <limitElements>true</limitElements>
  </changeSelection>
  </tArg>
  </GetDimElements>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<GetDimElementsResult 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">
<els xmlns="">
<e>
  <n>Item 1</n>
  <k>1</k>
  <h>0</h>
  <o>0</o>
  </e>
<e>
  <n>Item 2</n>
  <k>2</k>
  <h>0</h>
  <o>1</o>
  </e>
<e>
  <n>Item 3</n>
  <k>3</k>
  <h>0</h>
  <o>2</o>
  </e>
<e>
  <n>Item 4</n>
  <k>4</k>
  <h>0</h>
  <o>0</o>
  </e>
<e>
  <n>Fifth element</n>
  <k>5</k>
  <h>0</h>
  <o>0</o>
  </e>
  </els>
<id xmlns="">
  <id>S1!M!S!S1</id>
  </id>
<selectionInfo xmlns="">
<firstSelected>
  <n>Item 1</n>
  <k>1</k>
  <h>0</h>
  <o>0</o>
  </firstSelected>
<lastSelected>
  <n>Fifth element</n>
  <k>5</k>
  <h>0</h>
  <o>0</o>
  </lastSelected>
  <selectedCount>5</selectedCount>
<schema>
  <k>4294967295</k>
  <vis>1</vis>
  <applyOnlyOnce>0</applyOnlyOnce>
  <onceApplied>0</onceApplied>
  <applyOnRebuild>0</applyOnRebuild>
  </schema>
  </selectionInfo>
  </GetDimElementsResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"GetDimElements" :
{
"tDim" :
{
"id" : "S1!M!S!S1"
},
"tArg" :
{
"selectionInfo" : "true",
"changeSelection" :
{
"elSelectOp" : "Select",
"elRelative" : "All",
"limitElements" : "true"
}
}
}
}

JSON response:

{
"GetDimElementsResult" :
{
"els" :
{
"e" :
[
{
"n" : "First element",
"k" : "1",
"h" : "0",
"o" : "0"
},
{
"n" : "Second element",
"k" : "2",
"h" : "0",
"o" : "1"
},
{
"n" : "Third element",
"k" : "3",
"h" : "0",
"o" : "2"
},
{
"n" : "Fourth element",
"k" : "4",
"h" : "0",
"o" : "0"
},
{
"n" : "Fifth element",
"k" : "5",
"h" : "0",
"o" : "0"
}
]
},
"id" :
{
"id" : "S1!M!S!S1"
},
"selectionInfo" :
{
"firstSelected" :
{
"n" : "First element",
"k" : "1",
"h" : "0",
"o" : "0"
},
"lastSelected" :
{
"n" : "Fifth element",
"k" : "5",
"h" : "0",
"o" : "0"
},
"selectedCount" : "5",
"schema" :
{
"k" : "4294967295",
"vis" : "1",
"applyOnlyOnce" : "0",
"onceApplied" : "0",
"applyOnRebuild" : "0"
}
}
}
}
public static GetDimElementsResult SelectElementsBeforeGet(DmId moniker)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tElements = new GetDimElements()
{
tArg = new GetDimElementsArg()
{
//Selection parameters
changeSelection = new DmSelectionArg()
{
elSelectOp = DmElSelectOp.Select,
elRelative = DmElRelative.All,
limitElements = true
},
selectionInfo = true
},
tDim = moniker
};
//Get information about dictionary elements
var result = somClient.GetDimElements(tElements);
return result;
}

See also:

GetDimElements