Performing Checksums for Repository Objects

Below is the example of using the SetMbCheckSum operation to perform checksums of repository objects and to save the to file. The request contains keys of repository objects and the save empty field that indicates whether to save checksums. The response contains information about added objects and moniker of the obtained file with checksums.

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">
<SetMbCheckSum xmlns="http://www.fsight.ru/PP.SOM.Som">
<tMbCheckSum xmlns="">
  <id>S1!M!S!MbCheckSum1</id>
  </tMbCheckSum>
<tArg xmlns="">
<pattern>
  <itemsOperation>Add</itemsOperation>
  </pattern>
<meta>
<items>
<it>
  <k>8788</k>
  </it>
<it>
  <k>8784</k>
  </it>
  </items>
  <save />
  </meta>
<metaGet>
  <itemsOperation>Get</itemsOperation>
  </metaGet>
  </tArg>
  </SetMbCheckSum>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SetMbCheckSumResult 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!MbCheckSum1</id>
  </id>
<meta xmlns="">
<items>
<it>
  <k>8788</k>
  <id>OBJ8788</id>
  <n>Form</n>
  <vis>1</vis>
  <status>Undefined</status>
  <hash>BrLrPuFqHlGtJzNsAoAnByNoDkMpBsGx</hash>
<object ds="" isShortcut="0" isLink="0" ver="0" hf="0">
  <i>OBJ8788</i>
  <n>Form</n>
  <k>8788</k>
  <c>1538</c>
  <p>8777</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  </object>
  </it>
<it>
  <k>8784</k>
  <id>OBJ8784</id>
  <n>Dashboard</n>
  <vis>1</vis>
  <status>Undefined</status>
  <hash>EpByCwIkDxBpKwLwOpAoEpGvEmCtOmDx</hash>
<object ds="" isShortcut="0" isLink="0" ver="1" hf="0">
  <i>OBJ8784</i>
  <n>Dashboard</n>
  <k>8784</k>
  <c>8448</c>
  <p>8777</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  </object>
  </it>
  </items>
<save>
<binaryId>
  <id>S1!M!Bin!0</id>
  </binaryId>
  </save>
  </meta>
  </SetMbCheckSumResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"SetMbCheckSum" :
{
"tMbCheckSum" :
{
"id" : "S1!M!S!MbCheckSum1"
},
"tArg" :
{
"pattern" :
{
"itemsOperation" : "Add"
},
"meta" :
{
"items" :
{
"it" :
[
{
"k" : "8788"
},
{
"k" : "8784"
}
]
},
"save" : ""
},
"metaGet" :
{
"itemsOperation" : "Get"
}
}
}
}

JSON response:

{
"SetMbCheckSumResult" :
{
"id" :
{
"id" : "S1!M!S!MbCheckSum1"
},
"meta" :
{
"items" :
{
"it" :
[
{
"k" : "8788",
"id" : "OBJ8788",
"n" : "Form",
"vis" : "1",
"status" : "Undefined",
"hash" : "BrLrPuFqHlGtJzNsAoAnByNoDkMpBsGx",
"object" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "0",
"@hf" : "0",
"i" : "OBJ8788",
"n" : "Form",
"k" : "8788",
"c" : "1538",
"p" : "8777",
"h" : "0",
"hasPrv" : "0",
"ic" : "0"
}
},
{
"k" : "8784",
"id" : "OBJ8784",
"n" : "Dashboard",
"vis" : "1",
"status" : "Undefined",
"hash" : "EpByCwIkDxBpKwLwOpAoEpGvEmCtOmDx",
"object" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "1",
"@hf" : "0",
"i" : "OBJ8784",
"n" : "Dashboard",
"k" : "8784",
"c" : "8448",
"p" : "8777",
"h" : "0",
"hasPrv" : "0",
"ic" : "0"
}
}
]
},
"save" :
{
"binaryId" :
{
"id" : "S1!M!Bin!0"
}
}
}
}
}
public static SetMbCheckSumResult SaveCheckSum(string moniker)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tSet = new SetMbCheckSum()
{
tArg = new SetMbCheckSumArg()
{
pattern = new MbCheckSumMdPattern()
{
itemsOperation = ListOperation.Add
},
meta = new MbCheckSumMd()
{
items = new MbCheckSumMdItem[]
{
new MbCheckSumMdItem() { k = 8788 },
new MbCheckSumMdItem() { k = 8784 }
},
save = new MbCheckSumSave()
},
metaGet = new MbCheckSumMdPattern()
{
itemsOperation = ListOperation.Get
}
},
tMbCheckSum = new MbCheckSumId() { id = moniker }
};
// Save checksums
var result = somClient.SetMbCheckSum(tSet);
return result;
}

See also:

SetMbCheckSum