3
我想用web服务请求(soap v2)在Magento中创建类别。 我使用Magento 1.4.2.0,正如我所说的magentos soap api v2。Magento用肥皂创建类别v2
如果我把我碰到下面的错误作为响应的请求:
<?xml version="1.0" encoding="UTF-8" ?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>103</faultcode>
<faultstring>Attribute "include_in_menu" is required.</faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
的问题是,该XML标记“include_in_menu”是不是在要求提供。 如果我手动添加此标签,它将被忽略。
如果我不想使用soap v.1,该怎么办?
问候LStrike
PS:这是我的要求:
<?xml version="1.0" encoding="UTF-8"?><?xe.source ../../../Common/Data/login_response.xml#Envelope?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" media-type="text/xml"></xsl:output>
<xsl:template match="/">
<soapenv:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:urn="urn:Magento" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header></soapenv:Header>
<soapenv:Body>
<urn:catalogCategoryCreate soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<sessionId xsi:type="xsd:string">
<xsl:value-of select="soapenv:Envelope/soapenv:Body/urn:loginResponse/loginReturn"></xsl:value-of>
</sessionId>
<parentId xsi:type="xsd:int">
<xsl:value-of select="'3'"></xsl:value-of>
</parentId>
<categoryData xsi:type="urn:catalogCategoryEntityCreate">
<!--You may enter the following 19 items in any order-->
<!--Optional:-->
<name xsi:type="xsd:string">
<xsl:value-of select="'TestKategorie'"></xsl:value-of>
</name>
<!--Optional:-->
<is_active xsi:type="xsd:int">
<xsl:value-of select="'1'"></xsl:value-of>
</is_active>
<!--Optional:-->
<position xsi:type="xsd:int"></position>
<!--Optional:-->
<available_sort_by soapenc:arrayType="xsd:string[2]" xsi:type="ns1:ArrayOfString">
<item xsi:type="xsd:string">name</item>
<item xsi:type="xsd:string">price</item>
</available_sort_by>
<!--Optional:-->
<custom_design xsi:type="xsd:string"></custom_design>
<!--Optional:-->
<custom_design_apply xsi:type="xsd:int"></custom_design_apply>
<!--Optional:-->
<custom_design_from xsi:type="xsd:string"></custom_design_from>
<!--Optional:-->
<custom_design_to xsi:type="xsd:string"></custom_design_to>
<!--Optional:-->
<custom_layout_update xsi:type="xsd:string"></custom_layout_update>
<!--Optional:-->
<default_sort_by xsi:type="xsd:string"><xsl:value-of>name</xsl:value-of></default_sort_by>
<!--Optional:-->
<description xsi:type="xsd:string"></description>
<!--Optional:-->
<display_mode xsi:type="xsd:string"></display_mode>
<!--Optional:-->
<is_anchor xsi:type="xsd:int"></is_anchor>
<!--Optional:-->
<landing_page xsi:type="xsd:int"></landing_page>
<!--Optional:-->
<meta_description xsi:type="xsd:string"></meta_description>
<!--Optional:-->
<meta_keywords xsi:type="xsd:string"></meta_keywords>
<!--Optional:-->
<meta_title xsi:type="xsd:string"></meta_title>
<!--Optional:-->
<page_layout xsi:type="xsd:string"></page_layout>
<!--Optional:-->
<url_key xsi:type="xsd:string"></url_key>
<!-- selbst definierte Felder -->
<include_in_menu xsi:type="xsd:int">1</include_in_menu>
</categoryData>
<storeView xsi:type="xsd:string">
<xsl:value-of select="'default'"></xsl:value-of>
</storeView>
</urn:catalogCategoryCreate>
</soapenv:Body>
</soapenv:Envelope>
</xsl:template>
</xsl:stylesheet>
哇,这很快;)感谢您的回答,我会尝试。 – LStrike 2011-01-05 13:28:08
更好地使用第四种方式,并在1-2个月内等待下一个Magento发布 - 修复这个bug包含在其中。 – 2011-01-06 10:43:32
我在1.5版本中遇到了这个错误...您声称修复是在下一个版本中? – dmose 2011-03-14 19:34:17