I am trying to open and save a Component through Core Service.
I am using SDL Tridion 2011 SP1.
I have written some code segment like this.
ComponentData c = client.Read("tcm:30-53172", new ReadOptions()) as ComponentData;
Console.WriteLine("component");
FullVersionInfo itemInfo = null;
itemInfo = (FullVersionInfo)c.VersionInfo;
if (itemInfo.LockType.Value != LockType.CheckedOut)
{
client.CheckOut("tcm:30-53172", true, new ReadOptions());
Console.WriteLine("Checked out");
}
client.Save(c, null);
Console.WriteLine("Saved");
client.CheckIn("tcm:30-53172", new ReadOptions());
This program just opens and updates the Component (Save and Close).
I am getting following exception message.
Unable to find http://acaf/azba:Metadata.
But when I do the same action using Tridion UI, it is accepting. I am not getting any error message.
Actually there are no mandatory metadata fields in the schema. Even if I save and close the component from Tridion UI, I do not find any Metadata element in the item xml of the component. I do not want to change any value in the component. I just wanted to save and close the component through the core service.
I am unable to figure out the error message. Could some one help me to make this work.