cancel
Showing results for 
Search instead for 
Did you mean: 

Add custom attribute to SOAP API V2 response

Add custom attribute to SOAP API V2 response

Hi,

 

I'm using the Magento SOAP V2 API (php) to retrieve order information (salesOrderInfo). This returns an object with a shipping_address and billing_address property. For example:

 

[shipping_address] => stdClass Object
    (
        [parent_id] => 564
        [address_type] => shipping
        [firstname] => John
        [lastname] => Doe
        [company] => Johns shop
        [street] => Mystreet
        [city] => Mycity
        [postcode] => 12345
        [country_id] => NL
        [telephone] => 012345678
        [address_id] => 1128
    )


We use a custom property ("house") to store the house-number, but this property is not returned. I already tried adding it in /app/code/core/Mage/Sales/etc/wsdl.xml, but still no luck.

 

When I remove for example the "postcode" field in the wsdl.xml file, it does affect the returned object.

What am I missing? How can I add this field to the SOAP response?

 

Thanks!

1 REPLY 1

Re: Add custom attribute to SOAP API V2 response

Problem solved by clearing the wsdl-cache:

 

$soapClient = new SoapClient('http://server.com/?wsdl', array('cache_wsdl' => WSDL_CACHE_NONE) );