Opening Model

Below is the example of using the GetMs operation to open a model. The request contains an instance of opened modeling container and a pattern for opening the model. The response contains the opened model.

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">
<GetMs xmlns="http://www.fsight.ru/PP.SOM.Som">
<tMs xmlns="">
  <id>GEGBFKLHGPMOFOAEIMFEBNKILLAKNJBEIKKFGPFLECLAJIMA!M!S!CEDFMNBMHGPMOFOAEEOKCHDKLPKPFFKNEILBKMMPKNGGGFEEE</id>
  </tMs>
<tArg xmlns="">
<pattern>
  <obInst>true</obInst>
  <scenarios>Get</scenarios>
  <period>true</period>
<item>
  <key>306669</key>
<model>
<transform>
  <inputs>Get</inputs>
  <outputs>Get</outputs>
  <kind>true</kind>
  </transform>
  </model>
  </item>
  </pattern>
  </tArg>
  </GetMs>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<GetMsResult 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>GEGBFKLHGPMOFOAEIMFEBNKILLAKNJBEIKKFGPFLECLAJIMA!M!S!CEDFMNBMHGPMOFOAEEOKCHDKLPKPFFKNEILBKMMPKNGGGFEEE</id>
  </id>
<meta xmlns="">
<obInst>
<obDesc ds="ключ 306480" isShortcut="0" isLink="0" ver="6" hf="0">
  <i>MODELSPACE</i>
  <n>Modeling container</n>
  <k>306480</k>
  <c>5121</c>
  <p>1580</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  <trackElementDependents>0</trackElementDependents>
  <isPermanent>1</isPermanent>
  <isTemp>0</isTemp>
  </obDesc>
  </obInst>
  <dirty>0</dirty>
<period>
  <start>1968-12-08</start>
  <end>2022-12-31</end>
  </period>
<scenarios>
<nodes>
<it isFolder="0">
  <k>306497</k>
  <id>OBJ306497</id>
  <n>Base</n>
  <vis>1</vis>
<scenDesc ds="" isShortcut="0" isLink="0" ver="2" hf="0">
  <i>OBJ306497</i>
  <n>Base</n>
  <k>306497</k>
  <c>5124</c>
  <p>306485</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  <trackElementDependents>0</trackElementDependents>
  </scenDesc>
  <internalKey>306497</internalKey>
  </it>
  </nodes>
  </scenarios>
<item>
  <k>306669</k>
  <id>OBJ306669</id>
  <n>Model</n>
  <vis>1</vis>
  <type>Problem</type>
  </item>
  </meta>
  </GetMsResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"GetMs" :
{
"tMs" :
{
"id" : "GEGBFKLHGPMOFOAEIMFEBNKILLAKNJBEIKKFGPFLECLAJIMA!M!S!CEDFMNBMHGPMOFOAEEOKCHDKLPKPFFKNEILBKMMPKNGGGFEEE"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"scenarios" : "Get",
"period" : "true",
"item" :
{
"key" : "306669",
"model" :
{
"transform" :
{
"inputs" : "Get",
"outputs" : "Get",
"kind" : "true"
}
}
}
}
}
}
}

JSON response:

{
"GetMsResult" :
{
"id" :
{
"id" : "GEGBFKLHGPMOFOAEIMFEBNKILLAKNJBEIKKFGPFLECLAJIMA!M!S!CEDFMNBMHGPMOFOAEEOKCHDKLPKPFFKNEILBKMMPKNGGGFEEE"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "key 306480",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "6",
"@hf" : "0",
"i" : "MODELSPACE",
"n" : "Modeling container",
"k" : "306480",
"c" : "5121",
"p" : "1580",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0",
"isPermanent" : "1",
"isTemp" : "0"
}
},
"dirty" : "0",
"period" :
{
"start" : "1968-12-08",
"end" : "2022-12-31"
},
"scenarios" :
{
"nodes" :
{
"it" :
{
"@isFolder" : "0",
"k" : "306497",
"id" : "OBJ306497",
"n" : "Basic",
"vis" : "1",
"scenDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "2",
"@hf" : "0",
"i" : "OBJ306497",
"n" : "Basic",
"k" : "306497",
"c" : "5124",
"p" : "306485",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0"
},
"internalKey" : "306497"
}
}
},
"item" :
{
"k" : "306669",
"id" : "OBJ306669",
"n" : "Model",
"vis" : "1",
"type" : "Problem"
}
}
}
}
public static MsItem GetMsOpenModel(MsId ms, uint modelKey)
{
// Set operation execution parameters
var getMsOp = new GetMs()
{
tArg = new GetMsArg()
{ // Set general data extraction pattern
pattern = new MsMdPattern()
{
scenarios = ListOperation.Get,
period = true,
item = new MsItemPattern()
{
// Key of opened model
key = modelKey,
model = new MsModelPattern()
{
transform = new MsFormulaTransformPattern()
{
kind = true,
inputs = ListOperation.Get,
outputs = ListOperation.Get
}
}
}
}
},
tMs = ms
};
// Create a proxy object for operation execution
var somClient = new SomPortTypeClient();
// Open model
var result = somClient.GetMs(getMsOp);
return result.meta.item;
}

See also:

GetMs: Operation