Saving Update to File

Below is the example of using the SetMbUpdate operation to save updates to file. The update moniker and save command are sent in the query. The moniker of received file is sent in the request. The obtained moniker can be further used to load update from file.

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>Save</command>
  <async>false</async>
<saveToFile>
  <newFormat>true</newFormat>
  </saveToFile>
  </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>Finished</state>
<saveToFile>
<binaryId>
  <id>S1!M!Bin!0</id>
  </binaryId>
  <newFormat>1</newFormat>
  </saveToFile>
  </execute>
  </meta>
  </SetMbUpdateResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

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

JSON response:

{
"SetMbUpdateResult" :
{
"id" :
{
"id" : "S1!M!S!MbUpd1"
},
"meta" :
{
"execute" :
{
"resolveTimeout" : "600000",
"state" : "Finished",
"saveToFile" :
{
"binaryId" :
{
"id" : "S1!M!Bin!0"
},
"newFormat" : "1"
}
}
}
}
}
public static SetMbUpdateResult SaveUpdate(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.Save,
async = false,
saveToFile = new MbUpdateMdSaveToFile()
{
newFormat = true
}
}
},
metaGet = new MbUpdateMdPattern()
{
execute = true
}
},
tMbUpdate = new MbUpdateId() { id = moniker }
};
//Save update
var result = somClient.SetMbUpdate(tSet);
return result;
}

See also:

SetMbUpdate