Magento – Howto read/update newly created custom category attribute via SOAP API V2 – ASP.NET/C#

apice-1.7.0.2

I managed to create a custom attribute for a category using custom module and following 'sqlscript':

$installer = $this;
$installer->startSetup();
$attribute  = array(
    'type' => 'varchar',
    'label'=> 'Legacy Id',
    'input' => 'text',
    'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
    'visible' => true,
    'required' => false,
    'user_defined' => true,
    'default' => "",
    'group' => "General Information"
);
$installer->addAttribute('catalog_category', 'legacy_id', $attribute);
$installer->endSetup();

Attribute is visible and editable in admin section.

Now I want to read/update this attribute through SOAP API V2 in a asp.net/c# application, but I am not able to get to the custom attribute.
When I use catalogCategoryAttributeList I get a list of all attributes including the one I created, however when I use method catalogCategoryInfo it shows only default attributes. I am not sure what parameter string[] attribute does. No matter what I put here, I always get the same result.
And I assume that I need to use that method to get to the attributes of that category (according to magento API documentation on getting category info).

Code-snippet:

catalogAttributeEntity[] List = Service.catalogCategoryAttributeList(SessionKey);
catalogAttributeEntity LegacyIdAttr = List.Where(c => c.code == "legacy_id").FirstOrDefault();
Category = Service.catalogCategoryInfo(SessionKey, 5681, null, null);

I hope someone can put me in the right direction on how to get my custom attribute and
possibly change it's value.
Thanks in advance.

Best Answer

It seams that the API for categories does not work similar to the products. For the products you can get and set 'additional_attributes'.
In my opinion you need to extend the type definitions for the category methods to make your field behave just like the core fields.
Here are some details about how you can extend the type definitions The explanations are for extending types related to the products, but you can do the same for categories.
The main idea is to create an extension, add the file etc/wsdl.xml inside the extension (and wsi.xml if you use WSI Complience). In wsdl.xml add your missing attributes, and Magento will merge your file with the ones from the core.
You need to extend the following types catalogCategoryInfo, catalogCategoryEntityCreate