Opening Parameteric Dictionary

Below is the example of using the OpenDim operation to open a parametric dictionary of the repository. The request contains the moniker of the object that is a dictionary and parameter values. It is expected that parameters in the dictionary structure have the YEAR_START and YEAR_FINISH identifiers. The response contains the opened dictionary moniker. Any additional data of the dictionary is not obtained.

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

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">
<OpenDim xmlns="http://www.fsight.ru/PP.SOM.Som">
<tObject xmlns="">
  <id>S1!M!128</id>
  </tObject>
<tArg xmlns="">
<openArgs>
<args>
<it>
  <k>18446744073709551615</k>
  <id>YEAR_START</id>
  <value>2000</value>
  </it>
<it>
  <k>18446744073709551615</k>
  <id>YEAR_FINISH</id>
  <value>2001</value>
  </it>
  </args>
  </openArgs>
  </tArg>
  </OpenDim>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<OpenDimResult 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!S2</id>
  </id>
  </OpenDimResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"OpenDim" :
{
"tObject" :
{
"id" : "S1!M!128"
},
"tArg" :
{
"openArgs" :
{
"args" :
{
"it" :
[
{
"k" : "18446744073709551615",
"id" : "YEAR_START",
"value" : "2000"
},
{
"k" : "18446744073709551615",
"id" : "YEAR_FINISH",
"value" : "2001"
}
]
}
}
}
}
}

JSON response:

{
"OpenDimResult" :
{
"id" :
{
"id" : "S1!M!S!S2"
}
}
}
public static OpenDimResult OpenParamDimension(MbId mb, string id)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tOpen = new OpenDim()
{
tArg = new OpenDimArg()
{
openArgs = new DmOpenArgs()
{
//Parametric dictionary parameters
args = new OdArg[2]
{
new OdArg(){id = "YEAR_START", value = "2000", k = ulong.MaxValue},
new OdArg(){id = "YEAR_FINISH", value = "2001", k = ulong.MaxValue}
}
}
},
tObject = new OdId() { id = mb.id + "!" + FindObjectById(mb, id).k }
};
//Open parametric dictionary
var tResult = somClient.OpenDim(tOpen);
return tResult;
}

See also:

OpenDim: Operation