Search code examples
magentosoapmagento-soap-api

Magento Enterprise 1.12 - Accessing customer custom attributes from the V2 API


I've got a client that would like to use Magento's web services API to create and update customers. Using the API we can easily manipulate the system defined attributes - firstname, lastname, etc using the V1 or V2 API. Se we're good to go there.

This is where it gets sticky - this site uses Magento Enterprise 1.12 and we have added some custom customer attributes for linking the Magento customers to their CRM data on an external system. Using the V1 API, I have full access to the custom attributes. However, the V2 API will not expose them. Since the caller is coming from .NET, I believe he needs to use the V2 API.

Tracing the code with a debugger, I see that the V2 code gets all the attribute data and then drops all the custom data when the web service response is generated. I tried adding the attributes to the Customer (Mage/Customer/etc/) WSDL and WSI files, but that did not do the trick.

Can anyone give me a pointer as to what I should do to expose the customer attributes?

Greg


Solution

    1. Create a new module
    2. In Your_Module/etc/wsdl.xml and wsi.xml add your new attribute in the same node as in the Mage_Customer wsdl.xml and wsi.xml
    3. Magento merges all wsdl.xml and wsi.xml files together