Tridion2013. Can someone provide example of core service code retrieving list of metadata fields of a component from multiple folders. Instead of hardcoding the metadata field name, I would like to retrieve all metadata fields from the component.
So now you got the metadata xml of the component, the Tridion core service role is over; it's all about compiling the xml and get the desired things out of it using .net.
So assuming you want to get the values of metadata fields, you can follow the below example code, I haven't run it though so you may need some adjustments as well.
doc = XDocument.Parse(component.Metadata);
xmlData = doc.Root;
var elements= xmlData.Descendants();
foreach (XElement element in elements)
//get the value using element.Value
There are many core service code examples available in the Tridion Practice Cookbook. You can browse through them here: https://github.com/TridionPractice/tridion-practice?files=1
There are also many online blogs and q&a here with code samples too. Have a browse through, and if you still are stuck, let us know what exactly it is you're stuck on and we'd be happy to help.