Loading Checksums from File and Checking Repository Objects

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.

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!MbCheckSum2</id>
  </tMbCheckSum>
<tArg xmlns="">
  <pattern />
<meta>
<load>
<binaryId>
  <id>S1!M!Bin!0</id>
  </binaryId>
  </load>
  </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!MbCheckSum2</id>
  </id>
<meta xmlns="">
<items>
<it>
  <k>8788</k>
  <id>OBJ8788</id>
  <n>Form</n>
  <vis>1</vis>
  <status>Identical</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>Identical</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>
  </meta>
  </SetMbCheckSumResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"SetMbCheckSum" :
{
"tMbCheckSum" :
{
"id" : "S1!M!S!MbCheckSum2"
},
"tArg" :
{
"pattern" : "",
"meta" :
{
"load" :
{
"binaryId" :
{
"id" : "S1!M!Bin!0"
}
}
},
"metaGet" :
{
"itemsOperation" : "Get"
}
}
}
}

JSON response:

{
"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:

SetMbCheckSum