Deleting Elements

Below is the example of using the SetRdsElements operation to delete elements from an MDM dictionary. The request contains keys of the elements to be deleted. The response contains the number of deleted elements.

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">
<SetRdsElements xmlns="http://www.fsight.ru/PP.SOM.Som">
<tRds xmlns="">
  <id>S1!M!S!N5</id>
  </tRds>
<tArg xmlns="">
  <op>Unknown</op>
<key>
  <key />
  </key>
<del>
<its>
<it>
  <key>4</key>
  </it>
<it>
  <key>3</key>
  </it>
  </its>
  </del>
  </tArg>
  </SetRdsElements>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SetRdsElementsResult 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!N5</id>
  </id>
<key xmlns="">
  <key />
  </key>
<del xmlns="">
  <count>2</count>
  </del>
  </SetRdsElementsResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"SetRdsElements" :
{
"tRds" :
{
"id" : "S1!M!S!N5"
},
"tArg" :
{
"op" : "Unknown",
"key" :
{
"key" : ""
},
"del" :
{
"its" :
{
"it" :
[
{
"key" : "4"
},
{
"key" : "3"
}
]
}
}
}
}
}

JSON response:

{
"SetRdsElementsResult" :
{
"id" :
{
"id" : "S1!M!S!N5"
},
"key" :
{
"key" : ""
},
"del" :
{
"count" : "2"
}
}
}
public static SetRdsElementsResult DeleteRDSElements(RdsId moniker, ElKey[] elements)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tSet = new SetRdsElements()
{
tArg = new SetRdsElementsArg()
{
key = new ElKey()
{
key = string.Empty
},
del = new RdsDeleteElementsArg()
{
its = elements
}
},
tRds = moniker
};
//Delete elements
var tResult = somClient.SetRdsElements(tSet);
return tResult;
}

See also:

SetRdsElements