Installing Update

Below is the example of using the SetMbUpdate operation to start the update installation. The update moniker and installation execution parameters are sent in the query. The information about installation results is sent in the response.

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>S1!M!S!MbUpd1</id>
  </tMbUpdate>
<tArg xmlns="">
<pattern>
  <execute>true</execute>
  </pattern>
<meta>
<execute>
  <command>Apply</command>
  <async>false</async>
  </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>S1!M!S!MbUpd1</id>
  </id>
<meta xmlns="">
<execute>
  <resolveTimeout>600000</resolveTimeout>
  <state>Waiting</state>
<callback>
<onProgress>
  <stage>Start</stage>
  <total>1</total>
  <current>1</current>
  </onProgress>
  </callback>
  </execute>
  </meta>
  </SetMbUpdateResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"SetMbUpdate" :
{
"tMbUpdate" :
{
"id" : "S1!M!S!MbUpd1"
},
"tArg" :
{
"pattern" :
{
"execute" : "true"
},
"meta" :
{
"execute" :
{
"command" : "Apply",
"async" : "false"
}
},
"metaGet" :
{
"execute" : "true"
}
}
}
}

JSON response:

{
"SetMbUpdateResult" :
{
"id" :
{
"id" : "S1!M!S!MbUpd1"
},
"meta" :
{
"execute" :
{
"resolveTimeout" : "600000",
"state" : "Waiting",
"callback" :
{
"onProgress" :
{
"stage" : "Start",
"total" : "1",
"current" : "1"
}
}
}
}
}
}
public static SetMbUpdateResult ApplyUpdate(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()
{
command = MbUpdateExecuteCommand.Apply,
async = false
},
},
metaGet = new MbUpdateMdPattern()
{
execute = true
}
},
tMbUpdate = new MbUpdateId() { id = moniker }
};
//Install update
var result = somClient.SetMbUpdate(tSet);
return result;
}

See also:

SetMbUpdate