Updating Information about Element

Below is the example of using the SetRdsElements operation to update information about an MDM dictionary element. The request contains element key and new information about it. The response contains key of the element, for which the operation was executed.

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">
<SetRdsElements xmlns="http://www.fsight.ru/PP.SOM.Som">
<tRds xmlns="">
  <id>S1!M!S!N5</id>
  </tRds>
<tArg xmlns="">
  <op>Update</op>
<key>
  <key>3</key>
  </key>
<data>
  <n>New name</n>
  <k>3</k>
  <h>false</h>
  <o>0</o>
  </data>
  </tArg>
  </SetRdsElements>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SetRdsElementsResult 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!N5</id>
  </id>
<key xmlns="">
  <key>3</key>
  </key>
  </SetRdsElementsResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"SetRdsElements" :
{
"tRds" :
{
"id" : "S1!M!S!N5"
},
"tArg" :
{
"op" : "Update",
"key" :
{
"key" : "3"
},
"data" :
{
"n" : "New name",
"k" : "3",
"h" : "false",
"o" : "0"
}
}
}
}

JSON response:

{
"SetRdsElementsResult" :
{
"id" :
{
"id" : "S1!M!S!N5"
},
"key" :
{
"key" : "3"
}
}
}
public static SetRdsElementsResult UpdateRdsElementInfo(RdsId moniker, string elementKey, string newElementName)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
//Operation execution parameters
var tSet = new SetRdsElements()
{
tArg = new SetRdsElementsArg()
{
op = RdsElementOperation.Update,
//Key of element to be updated
key = new ElKey()
{
key = elementKey
},
data = new ElData()
{
k = elementKey,
n = newElementName
}
},
tRds = moniker
};
//Update information in alphabetic order
var tResult = somClient.SetRdsElements(tSet);
return tResult;
}

See also:

SetRdsElements