Opening Modeling Container for Edit

Below is the example of using the OpenMs operation to open a modeling container for edit. The request contains the container moniker and whether the container must be opened for edit. The response contains moniker of opened modeling container instance. Any additional data 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">
<OpenMs xmlns="http://www.fsight.ru/PP.SOM.Som">
<tOb xmlns="">
  <id>GEGBFKLHGPMOFOAEIMFEBNKILLAKNJBEIKKFGPFLECLAJIMA!M!306480</id>
  </tOb>
<tArg xmlns="">
<args>
  <openForEdit>true</openForEdit>
  </args>
  </tArg>
  </OpenMs>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<OpenMsResult 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>
  <readOnly xmlns="">0</readOnly>
  </OpenMsResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"OpenMs" :
{
"tOb" :
{
"id" : "GEGBFKLHGPMOFOAEIMFEBNKILLAKNJBEIKKFGPFLECLAJIMA!M!306480"
},
"tArg" :
{
"args" :
{
"openForEdit" : "true"
}
}
}
}

JSON response:

{
"OpenMsResult" :
{
"id" :
{
"id" : "GEGBFKLHGPMOFOAEIMFEBNKILLAKNJBEIKKFGPFLECLAJIMA!M!S!CEDFMNBMHGPMOFOAEEOKCHDKLPKPFFKNEILBKMMPKNGGGFEEE"
},
"readOnly" : "0"
}
}
public static MsId OpenMsEdit(MbId mb, string msId)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
// Set operation execution parameters
var tMsOp = new OpenMs()
{
tArg = new OpenMsArg()
{
// Set container opening parameters
args = new MsOpenArgs()
{
openForEdit = true
}
},
// Create object moniker
tOb = new OdId() { id = mb.id + "!" + FindObjectById(mb, msId).k }
};
// Open modeling container for edit
var result = somClient.OpenMs(tMsOp);
return result.id;
}

See also:

OpenMs: Operation