Resuming Update Installation

Below is the example of using the SetMbUpdate operation to resume the update installation. The example must be executed cyclically after update installation was started. Installation can be continued until the SetMbUpdateResult.meta.execute.state field returns Finished or FinishedWithError after executing the operation.

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">
<SetMbUpdate xmlns="http://www.fsight.ru/PP.SOM.Som">
<tMbUpdate xmlns="">
  <id>HIDMDIEFBHCHGOAEGIHPHLGMDNKCMEDEBIGGMJJBPLDGFEOG!M!S!MbUpdOJFBNIEFBHCHGOAEJCKDBGBGODBNBCBEIIDAJOFDEKCIONGC</id>
  </tMbUpdate>
<tArg xmlns="">
<pattern>
  <execute>true</execute>
  </pattern>
<meta>
<execute>
  <async>false</async>
<callback>
  <onProgress />
  </callback>
  </execute>
  </meta>
<metaGet>
  <execute>true</execute>
  </metaGet>
  </tArg>
  </SetMbUpdate>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SetMbUpdateResult 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>HIDMDIEFBHCHGOAEGIHPHLGMDNKCMEDEBIGGMJJBPLDGFEOG!M!S!MbUpdOJFBNIEFBHCHGOAEJCKDBGBGODBNBCBEIIDAJOFDEKCIONGC</id>
  </id>
<meta xmlns="">
<execute>
  <resolveTimeout>600000</resolveTimeout>
  <state>Finished</state>
  </execute>
  </meta>
  </SetMbUpdateResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"SetMbUpdate" :
{
"tMbUpdate" :
{
"id" : "HIDMDIEFBHCHGOAEGIHPHLGMDNKCMEDEBIGGMJJBPLDGFEOG!M!S!MbUpdOJFBNIEFBHCHGOAEJCKDBGBGODBNBCBEIIDAJOFDEKCIONGC"
},
"tArg" :
{
"pattern" :
{
"execute" : "true"
},
"meta" :
{
"execute" :
{
"async" : "false",
"callback" :
{
"onProgress" : ""
}
}
},
"metaGet" :
{
"execute" : "true"
}
}
}
}

JSON response:

{
"SetMbUpdateResult" :
{
"id" :
{
"id" : "HIDMDIEFBHCHGOAEGIHPHLGMDNKCMEDEBIGGMJJBPLDGFEOG!M!S!MbUpdOJFBNIEFBHCHGOAEJCKDBGBGODBNBCBEIIDAJOFDEKCIONGC"
},
"meta" :
{
"execute" :
{
"resolveTimeout" : "600000",
"state" : "Finished"
}
}
}
}
public static SetMbUpdateResult UpdateExecuteState(string moniker)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tSet = new SetMbUpdate()
{
tArg = new SetMbUpdateArg()
{
pattern = new MbUpdateMdPattern()
{
execute = true
},
meta = new MbUpdateMd()
{
execute = new MbUpdateExecute()
{
callback = new MbUpdateExecuteCallback()
{
onProgress = new MbUpdateProgressData() //To allow execution callback
},
async = false
},
},
metaGet = new MbUpdateMdPattern()
{
execute = true
}
},
tMbUpdate = new MbUpdateId() { id = moniker }
};
var result = somClient.SetMbUpdate(tSet);
// Cyclic execution of SetMbUpdate until the update is completely installed
do
{
// Resume update
result = somClient.SetMbUpdate(tSet);
} while ((result.meta.execute.state != MbUpdateExecuteState.Finished) && (result.meta.execute.state != MbUpdateExecuteState.FinishedWithError));
return result;
}

See also:

SetMbUpdate