Deleting Several Objects

Below is the example of using the DeleteObjects operation to delete multiple objects from the repository. The request contains moniker of repository connection and description of deleted objects.

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">
<DeleteObjects xmlns="http://www.fsight.ru/PP.SOM.Som">
<tMb xmlns="">
  <id>FNDKOLJACBNNFOAEDCEENEKPOGMMOOGEBLEIHFKEJOFOFMNJ!M</id>
  </tMb>
<tArg xmlns="">
<objects>
<its>
<d isShortcut="false" isLink="false" hf="false">
  <i>NEWFORM1</i>
  <n>NewForm1</n>
  <k>305000</k>
  <c>1538</c>
  <p>65</p>
  <h>false</h>
  <hasPrv>false</hasPrv>
  <ic>false</ic>
  </d>
<d isShortcut="false" isLink="false" hf="false">
  <i>NEWFORM2</i>
  <n>NewForm2</n>
  <k>305001</k>
  <c>1538</c>
  <p>65</p>
  <h>false</h>
  <hasPrv>false</hasPrv>
  <ic>false</ic>
  </d>
  </its>
  </objects>
  </tArg>
  </DeleteObjects>
  </s:Body>
  </s:Envelope>

SOAP response:

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

JSON request:

{
"DeleteObjects" :
{
"tMb" :
{
"id" : "FNDKOLJACBNNFOAEDCEENEKPOGMMOOGEBLEIHFKEJOFOFMNJ!M"
},
"tArg" :
{
"objects" :
{
"its" :
{
"d" :
[
{
"@isShortcut" : "false",
"@isLink" : "false",
"@hf" : "false",
"i" : "NEWFORM1",
"n" : "NewForm1",
"k" : "305000",
"c" : "1538",
"p" : "65",
"h" : "false",
"hasPrv" : "false",
"ic" : "false"
},
{
"@isShortcut" : "false",
"@isLink" : "false",
"@hf" : "false",
"i" : "NEWFORM2",
"n" : "NewForm2",
"k" : "305001",
"c" : "1538",
"p" : "65",
"h" : "false",
"hasPrv" : "false",
"ic" : "false"
}
]
}
}
}
}
}

JSON response:

{
"DeleteObjectsResult" : ""
}
public static DeleteObjectsResult DelObjects(MbId mb, Od[] objects)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tDel = new DeleteObjects()
{
tArg = new DeleteObjectsArg()
{
objects = new Ods
{
its = objects
}
},
tMb = new MbId() { id = mb.id }
};
//Delete objects
var result = somClient.DeleteObjects(tDel);
return result;
}

See also:

DeleteObjects: Operation