10

We've updated the standard WSDL definitions to support bundled product attributes for sku_type and price_type. I've tried putting the updated WSDL and WSI files in app/code/local/Mage/Catalog/etc/, but Magento doesn't load them. I don't want to leave them in the core area, but that seems to be the only place I can get Magento to find them.

Any suggestions?

14

You can have wsdl definitions in the local folder also. What you need to do is to create a custom module. In your custom module you can add the files api.xml, wsdl.xml and wsi.xml inside the etc folder.

Your wsdl.xml file should be taken into consideration when building the actual wsdl. Magento merges all wsdl.xml files from all the modules that have one (same goes for api.xml and wsi.xml). These files are merged, so you don't need the full xml file from Mage_Catalog model. You can add only the pieces you need, just make sure you keep the same path.

Here is a simple example. In wsdl.xml from Mage_Catalog there is this piece of code:

<definitions...>
    <types>
        <schema ...>
            <complexType name="catalogProductEntity">
                <all>
                    <element name="product_id" type="xsd:string"/>
                    <element name="sku" type="xsd:string"/>
                    <element name="name" type="xsd:string"/>
                    <element name="set" type="xsd:string"/>
                    <element name="type" type="xsd:string"/>
                    <element name="category_ids" type="typens:ArrayOfString"/>
                    <element name="website_ids" type="typens:ArrayOfString"/>
                </all>
            </complexType>
        </schema>
    </types>
</definitions>

And you want to add an other field to this type, all you have to do in your wsdl.xml file from your custom module is this:

    <definitions...>
        <types>
            <schema ...>
                <complexType name="catalogProductEntity">
                    <all>
                        <element name="custom_attribute" type="xsd:string"/>
                    </all>
                </complexType>
            </schema>
        </types>
    </definitions>

(add the attributes for the tags definitions and schema that I've replaced with '...').

  • Thanks Marius, that makes sense. I'll add these definitions to our custom module and have it add to the master WSDL definition. I wasn't thinking of these as similar to layout and config files. Magic! – GregC Mar 13 '13 at 18:50
  • This is really handy. – philwinkle Jan 6 '14 at 23:26
  • Marius, I want to overwrite the catalogProductAttributeSetAttributeAdd response from bool to int. But now it's showing both. How do I do that? – Refilon Dec 22 '15 at 13:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.