Below is the example of using the SetMbCheckSum operation for loading checksums and checking repository objects. The request contains moniker of the file with checksums. The response contains information about repository objects, the result of verifying checksums is obtained for each object.
{
"SetMbCheckSum" :
{
"tMbCheckSum" :
{
"id" : "S1!M!S!MbCheckSum2"
},
"tArg" :
{
"pattern" : "",
"meta" :
{
"load" :
{
"binaryId" :
{
"id" : "S1!M!Bin!0"
}
}
},
"metaGet" :
{
"itemsOperation" : "Get"
}
}
}
}
{
"SetMbCheckSumResult" :
{
"id" :
{
"id" : "S1!M!S!MbCheckSum2"
},
"meta" :
{
"items" :
{
"it" :
[
{
"k" : "8788",
"id" : "OBJ8788",
"n" : "Form",
"vis" : "1",
"status" : "Identical",
"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" : "Identical",
"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"
}
}
]
}
}
}
}
public static SetMbCheckSumResult LoadCheckSum(string moniker, string checkSumBinaryId)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tSet = new SetMbCheckSum()
{
tArg = new SetMbCheckSumArg()
{
pattern = new MbCheckSumMdPattern() {},
meta = new MbCheckSumMd()
{
load = new MbCheckSumLoad() { binaryId = new BinaryId() { id = checkSumBinaryId } }
},
metaGet = new MbCheckSumMdPattern()
{
itemsOperation = ListOperation.Get
}
},
tMbCheckSum = new MbCheckSumId() { id = moniker }
};
// Load checksums
var result = somClient.SetMbCheckSum(tSet);
return result;
}
See also: