I am currently using a foreach loop to iterate through the products and then retrieving the attribute I need. This is very slow, because it makes a call for each product to the API and retrieves the attributes values.
Is there a way to get all products along with their attributes in one shot?
Here is my current code:
var session = client.login("xxx", "xxx");
catalogProductEntity[] product = new[] { new catalogProductEntity() };
client.catalogProductList(out product, session, null, null);
Console.WriteLine("Found {0} items", product.Length);
catalogProductRequestAttributes attributes = new catalogProductRequestAttributes();
attributes.additional_attributes = new string[] { "mynewattribute" };
foreach (var catalogProductEntity in product)
{
catalogProductReturnEntity catalogProductReturnEntity = client.catalogProductInfo(session, catalogProductEntity.product_id, null, attributes, null);
string attrValue = catalogProductReturnEntity.additional_attributes[0].value;
Console.WriteLine("attrValue => " + attrValue);
Console.WriteLine(catalogProductEntity.product_id);
}