开发者

Fatal error: Uncaught SoapFault exception: [103] Attribute "include_in_menu" is required

开发者 https://www.devze.com 2023-03-26 02:37 出处:网络
\"Fatal error: Uncaught SoapFault exception: [103] 开发者_如何转开发Attribute \"include_in_menu\" is required.\" was throwed when I using Magento API to create a category.

"Fatal error: Uncaught SoapFault exception: [103] 开发者_如何转开发Attribute "include_in_menu" is required." was throwed when I using Magento API to create a category.

In the Magento API, it says I need an array like this,

         array(
            'name'=>'Newopenerp',
            'is_active'=>1,
            'include_in_menu'=>2,
            'available_sort_by'=>'position',
            'default_sort_by'=>'position'
           )

When I run my script in localhost with Magento 1.5.1, everything looks fine. While in the server with Magento 1.5.0, this exception was thrown. I am wondering if this is caused by version change.

I tried my best to debug this, got nothing after one day. I make sure this is a problem of Magento API, maybe there is a another data type for 'include_in_menu' in Magento 1.5.0.

I really want to know what happened here!

PS: I got some useful information at http://sourceforge.net/projects/jtlmage/forums/forum/1009350/topic/4028894. But it's not in English so I can't get what it means. Hope it's helpful for anyone's help!

Thanks in advance.


Please go to this path "app/code/core/Mage/Catalog/etc/", and open this file "wsdl.xml". Then go to this line #187, and you will find this following code block for the Magento v1.5.0.1:-

<complexType name="catalogCategoryEntityCreate">
    <all>
        <element name="name" type="xsd:string" minOccurs="0" />
        <element name="is_active" type="xsd:int" minOccurs="0" />
        <element name="position" type="xsd:int" minOccurs="0" />
        <element name="available_sort_by" type="typens:ArrayOfString" minOccurs="0" />
        <element name="custom_design" type="xsd:string" minOccurs="0" />
        <element name="custom_design_apply" type="xsd:int" minOccurs="0" />
        <element name="custom_design_from" type="xsd:string" minOccurs="0" />
        <element name="custom_design_to" type="xsd:string" minOccurs="0" />
        <element name="custom_layout_update" type="xsd:string" minOccurs="0" />
        <element name="default_sort_by" type="xsd:string" minOccurs="0" />
        <element name="description" type="xsd:string" minOccurs="0" />
        <element name="display_mode" type="xsd:string" minOccurs="0" />
        <element name="is_anchor" type="xsd:int" minOccurs="0" />
        <element name="landing_page" type="xsd:int" minOccurs="0" />
        <element name="meta_description" type="xsd:string" minOccurs="0" />
        <element name="meta_keywords" type="xsd:string" minOccurs="0" />
        <element name="meta_title" type="xsd:string" minOccurs="0" />
        <element name="page_layout" type="xsd:string" minOccurs="0" />
        <element name="url_key" type="xsd:string" minOccurs="0" />
    </all>
</complexType>

Here if you follow all the elements, you will be able to know what all attributes / elements are required.

As for your question, you are right that in Magento v1.5.1.0, the element "include_in_menu" is present for the same attribute. However, the Magento v1.5.0.1 doesn't have any such element present in the "wsdl.xml" file, and you will require to remove this element from your array elements list.

Also I would like to let you know that I would not recommend you to add this element in the "complexType" data, since that will mean that you are making holes in the core & that will only hamper your Magento when you will make any upgradation of your Magento core.

Hope it helps.


Shouldn't include_in_menu be a boolean, therefore 1 or 0?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号