2
Vote

Updating user defined attribute on Person is failing,with FIM 2010 Resource Management Client 1.0.0

description

Hi,
With this new FIM 2010 Resource Management Client 1.0.0, updating any user defined attribute on Person is failing, if that user defined attribute contains blanks value on FIM portal.
If user defined attribute on FIM portal contains some value then modify operation on user defined attribute gets successful.
Use case :
  • On FIM portal I created one new attribute ‘TestAttribute’ on Person
  • Attribute ‘TestAttribute’ is of string type.
  • Now for person ‘P1’ I kept ‘TestAttribute’ as blank
Now I want to update the ‘TestAttribute’ for person ‘P1’ using FIM 2010 Resource Management Client 1.0.0
But below code generate exception “The request message contains errors that prevent processing the request” while updating the field ‘TestAttribute’ for person ‘P1’

{
   DefaultClient client = new DefaultClient();
   client.ClientCredential = Credential.GetAdminCredential();
   client.RefreshSchema();
   string objType = "Person";
   string objName = "P1";
   string newval = "testvalue";
   RmPerson Rmper = null;
   bool _rcUpdate;
   foreach (RmResource fimResource in client.Enumerate("/" + objType + "[AccountName='" + objName + "']"))
        {
            Rmper = fimResource as RmPerson;
        }
   RmResourceChanges transaction = new RmResourceChanges(Rmper);
   transaction.BeginChanges();

  Rmper["TestAttribute"] = new RmAttributeValueSingle(newval);

   var attrChangeList = transaction.GetChanges();
   if (attrChangeList.Count > 0)
      {
          _rcUpdate = client.Put(transaction);
      }
    transaction.AcceptChanges();
}

Above code works, if user defined attribute on FIM portal contains some value then modify operation on user defined attribute is done using FIM 2010 Resource Management Client 1.0.0

Is there any thing going wrong with FIM 2010 Resource Management Client 1.0.0 ?

Thanks,
Rahul

comments