Creating a Modeling Container

Below is the example of using the OpenMs operation to create a modeling container. The request contains repository moniker and identifier of the container to be created. The response contains moniker of opened modeling container instance. Any additional data is not obtained.

NOTE. Before creating a modeling container make sure that a default MDM repository is defined for the current repository. To set a default MDM repository, use the property ISpecialObjects.SpecialObject(MetabaseSpecialObject.RdsDatabase).

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</id>
  </tOb>
<tArg xmlns="">
<args>
<openNew>
  <id>MS_NEW</id>
  <name>New Model Space</name>
  </openNew>
  </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!CHIPGGCMHGPMOFOAELLCEANGHCHAGCIGEALCDHOJCDACJCCGL</id>
  </id>
  <readOnly xmlns="">0</readOnly>
  </OpenMsResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"OpenMs" :
{
"tOb" :
{
"id" : "GEGBFKLHGPMOFOAEIMFEBNKILLAKNJBEIKKFGPFLECLAJIMA!M"
},
"tArg" :
{
"args" :
{
"openNew" :
{
"id" : "MS_NEW",
"name" : "New Model Space"
}
}
}
}
}

JSON response:

{
"OpenMsResult" :
{
"id" :
{
"id" : "GEGBFKLHGPMOFOAEIMFEBNKILLAKNJBEIKKFGPFLECLAJIMA!M!S!CHIPGGCMHGPMOFOAELLCEANGHCHAGCIGEALCDHOJCDACJCCGL"
},
"readOnly" : "0"
}
}
public static OpenMsResult OpenMsNew(MbId mb, string msId, string msName)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
// Set operation execution parameters
var tMsOp = new OpenMs()
{
tArg = new OpenMsArg()
{
// Set container creation parameters
args = new MsOpenArgs()
{
openNew = new MsOpenNew()
{
id = msId,
name = msName,
parent = null
}
}
},
// Create object moniker
tOb = new OdId() { id = mb.id }
};
// Create modeling container
var result = somClient.OpenMs(tMsOp);
return result;
}

See also:

OpenMs: Operation