Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从Magento v2.0 SOAP API获取产品类别ID_Magento_Magento2_Magento 2.0 - Fatal编程技术网

从Magento v2.0 SOAP API获取产品类别ID

从Magento v2.0 SOAP API获取产品类别ID,magento,magento2,magento-2.0,Magento,Magento2,Magento 2.0,如何使用Magento v2.0 SOAP web服务获取产品所属类别的列表 在上,我找到了一个服务列表 使用目录ProductRepositoryV1,我可以请求列表或单个产品,但它不包含类别。例如: 请求: POST http://domain/soap/default?services=catalogProductRepositoryV1 HTTP/1.1 Content-Type: application/soap+xml; charset=utf-8; action="catalogP

如何使用Magento v2.0 SOAP web服务获取产品所属类别的列表

在上,我找到了一个服务列表

使用
目录ProductRepositoryV1
,我可以请求列表或单个产品,但它不包含类别。例如:

请求:

POST http://domain/soap/default?services=catalogProductRepositoryV1 HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8; action="catalogProductRepositoryV1Get"
Host: domain
Content-Length: 382
Expect: 100-continue
Accept-Encoding: gzip, deflate

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <catalogProductRepositoryV1GetRequest xmlns="http://domain/soap/default?services=catalogProductRepositoryV1">
            <sku xmlns="">24-MB01</sku>
        </catalogProductRepositoryV1GetRequest>
    </s:Body>
</s:Envelope>
POSThttp://domain/soap/default?services=catalogProductRepositoryV1 HTTP/1.1
内容类型:应用程序/soap+xml;字符集=utf-8;action=“catalogProductRepositoryV1Get”
主机:域名
内容长度:382
预期:100人继续
接受编码:gzip,deflate
24-MB01
答复:

HTTP/1.1 200 OK
Date: Fri, 20 May 2016 12:21:46 GMT
Server: Apache/2.4.18 (Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4 PHP/5.6.21
X-Powered-By: PHP/5.6.21
Set-Cookie: PHPSESSID=89fdd89a6caeb8be424b9531c69d6c69; expires=Fri, 20-May-2016 13:21:47 GMT; Max-Age=3600; path=/; domain=domain; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Length: 5547
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Connection: close
Content-Type: application/soap+xml; charset=utf-8

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://domain/soap/default?services=catalogProductRepositoryV1">
    <env:Body>
        <ns1:catalogProductRepositoryV1GetResponse>
            <result>
                <id>1</id>
                <sku>24-MB01</sku>
                <name>Joust Duffle Bag</name>
                <attributeSetId>15</attributeSetId>
                <price>34</price>
                <status>1</status>
                <visibility>4</visibility>
                <typeId>simple</typeId>
                <createdAt>2016-01-22 16:28:25</createdAt>
                <updatedAt>2016-04-20 09:51:54</updatedAt>
                <extensionAttributes/>
                <productLinks>
                    <item>
                        <sku>24-MB01</sku>
                        <linkType>upsell</linkType>
                        <linkedProductSku>24-MB03</linkedProductSku>
                        <linkedProductType>simple</linkedProductType>
                        <position/>
                        <extensionAttributes/>
                    </item>
                    <item>
                        <sku>24-MB01</sku>
                        <linkType>upsell</linkType>
                        <linkedProductSku>24-MB05</linkedProductSku>
                        <linkedProductType>simple</linkedProductType>
                        <position/>
                        <extensionAttributes/>
                    </item>
                    <item>
                        <sku>24-MB01</sku>
                        <linkType>upsell</linkType>
                        <linkedProductSku>24-MB06</linkedProductSku>
                        <linkedProductType>simple</linkedProductType>
                        <position/>
                        <extensionAttributes/>
                    </item>
                    <item>
                        <sku>24-MB01</sku>
                        <linkType>upsell</linkType>
                        <linkedProductSku>24-MB02</linkedProductSku>
                        <linkedProductType>simple</linkedProductType>
                        <position/>
                        <extensionAttributes/>
                    </item>
                    <item>
                        <sku>24-MB01</sku>
                        <linkType>upsell</linkType>
                        <linkedProductSku>24-UB02</linkedProductSku>
                        <linkedProductType>simple</linkedProductType>
                        <position/>
                        <extensionAttributes/>
                    </item>
                    <item>
                        <sku>24-MB01</sku>
                        <linkType>upsell</linkType>
                        <linkedProductSku>24-WB03</linkedProductSku>
                        <linkedProductType>simple</linkedProductType>
                        <position/>
                        <extensionAttributes/>
                    </item>
                    <item>
                        <sku>24-MB01</sku>
                        <linkType>upsell</linkType>
                        <linkedProductSku>24-WB07</linkedProductSku>
                        <linkedProductType>simple</linkedProductType>
                        <position/>
                        <extensionAttributes/>
                    </item>
                    <item>
                        <sku>24-MB01</sku>
                        <linkType>upsell</linkType>
                        <linkedProductSku>24-WB04</linkedProductSku>
                        <linkedProductType>simple</linkedProductType>
                        <position/>
                        <extensionAttributes/>
                    </item>
                </productLinks>
                <options/>
                <mediaGalleryEntries>
                    <item>
                        <id>1</id>
                        <mediaType>image</mediaType>
                        <label>Image</label>
                        <position>1</position>
                        <disabled>false</disabled>
                        <types>
                            <item>image</item>
                            <item>small_image</item>
                            <item>thumbnail</item>
                        </types>
                        <file>/m/b/mb01-blue-0.jpg</file>
                    </item>
                </mediaGalleryEntries>
                <tierPrices/>
                <customAttributes>
                    <item>
                        <attributeCode>description</attributeCode>
                        <value>&lt;p&gt;The sporty Joust Duffle Bag can't be beat - not in the gym, not on the luggage carousel, not anywhere. Big enough to haul a basketball or soccer ball and some sneakers with plenty of room to spare, it's ideal for athletes with places to go.&lt;/p&gt;&#13;
&lt;ul&gt;&#13;
&lt;li&gt;Dual top handles.&lt;/li&gt;&#13;
&lt;li&gt;Adjustable shoulder strap.&lt;/li&gt;&#13;
&lt;li&gt;Full-length zipper.&lt;/li&gt;&#13;
&lt;li&gt;L 29" x W 13" x H 11".&lt;/li&gt;&#13;
&lt;/ul&gt;</value>
                    </item>
                    <item>
                        <attributeCode>meta_title</attributeCode>
                        <value>Joust Duffle Bag</value>
                    </item>
                    <item>
                        <attributeCode>meta_keyword</attributeCode>
                        <value>Joust Duffle Bag</value>
                    </item>
                    <item>
                        <attributeCode>meta_description</attributeCode>
                        <value>Joust Duffle Bag &lt;p&gt;The sporty Joust Duffle Bag can't be beat - not in the gym, not on the luggage carousel, not anywhere. Big enough to haul a basketball or soccer ball and some sneakers with plenty of room to spare, it's ideal for athletes with places t</value>
                    </item>
                    <item>
                        <attributeCode>image</attributeCode>
                        <value>/m/b/mb01-blue-0.jpg</value>
                    </item>
                    <item>
                        <attributeCode>small_image</attributeCode>
                        <value>/m/b/mb01-blue-0.jpg</value>
                    </item>
                    <item>
                        <attributeCode>thumbnail</attributeCode>
                        <value>/m/b/mb01-blue-0.jpg</value>
                    </item>
                    <item>
                        <attributeCode>category_ids</attributeCode>
                        <value>
                            <xsd:string>3</xsd:string>
                            <xsd:string>4</xsd:string>
                        </value>
                    </item>
                    <item>
                        <attributeCode>options_container</attributeCode>
                        <value>container2</value>
                    </item>
                    <item>
                        <attributeCode>required_options</attributeCode>
                        <value>0</value>
                    </item>
                    <item>
                        <attributeCode>has_options</attributeCode>
                        <value>0</value>
                    </item>
                    <item>
                        <attributeCode>image_label</attributeCode>
                        <value>Image</value>
                    </item>
                    <item>
                        <attributeCode>small_image_label</attributeCode>
                        <value>Image</value>
                    </item>
                    <item>
                        <attributeCode>thumbnail_label</attributeCode>
                        <value>Image</value>
                    </item>
                    <item>
                        <attributeCode>msrp_display_actual_price_type</attributeCode>
                        <value>0</value>
                    </item>
                    <item>
                        <attributeCode>url_key</attributeCode>
                        <value>joust-duffle-bag</value>
                    </item>
                    <item>
                        <attributeCode>tax_class_id</attributeCode>
                        <value>0</value>
                    </item>
                    <item>
                        <attributeCode>activity</attributeCode>
                        <value>11,19,21,22</value>
                    </item>
                    <item>
                        <attributeCode>style_bags</attributeCode>
                        <value>25,26,29</value>
                    </item>
                    <item>
                        <attributeCode>material</attributeCode>
                        <value>37,38</value>
                    </item>
                    <item>
                        <attributeCode>strap_bags</attributeCode>
                        <value>61,62,63,64,65,66</value>
                    </item>
                    <item>
                        <attributeCode>features_bags</attributeCode>
                        <value>74,76,79</value>
                    </item>
                    <item>
                        <attributeCode>eco_collection</attributeCode>
                        <value>0</value>
                    </item>
                    <item>
                        <attributeCode>performance_fabric</attributeCode>
                        <value>0</value>
                    </item>
                    <item>
                        <attributeCode>erin_recommends</attributeCode>
                        <value>0</value>
                    </item>
                    <item>
                        <attributeCode>new</attributeCode>
                        <value>0</value>
                    </item>
                    <item>
                        <attributeCode>sale</attributeCode>
                        <value>0</value>
                    </item>
                    <item>
                        <attributeCode>eboekhouden_grootboekrekening</attributeCode>
                        <value>8000</value>
                    </item>
                    <item>
                        <attributeCode>eboekhouden_costcenter</attributeCode>
                        <value>0</value>
                    </item>
                </customAttributes>
            </result>
        </ns1:catalogProductRepositoryV1GetResponse>
    </env:Body>
</env:Envelope>
HTTP/1.1200正常
日期:2016年5月20日星期五12:21:46 GMT
服务器:Apache/2.4.18(Unix)OpenSSL/1.0.1e-fips mod_bwlimited/1.4 PHP/5.6.21
X-Powered-By:PHP/5.6.21
设置Cookie:PHPSESSID=89fdd89a6caeb8be424b9531c69d6c69;expires=2016年5月20日星期五13:21:47 GMT;最大年龄=3600岁;路径=/;域=域;HttpOnly
到期时间:1981年11月19日星期四格林威治标准时间08:52:00
缓存控制:无存储,无缓存,必须重新验证,后检查=0,预检查=0
Pragma:没有缓存
内容长度:5547
X-Content-Type-Options:nosniff
X-XSS-Protection:1;模式=块
连接:关闭
内容类型:应用程序/soap+xml;字符集=utf-8
1.
24-MB01
拳击袋
15
34
1.
4.
简单的
2016-01-22 16:28:25
2016-04-20 09:51:54
24-MB01
追加销售
24-MB03
简单的
24-MB01
追加销售
24-MB05
简单的
24-MB01
追加销售
24-MB06
简单的
24-MB01
追加销售
24-MB02
简单的
24-MB01
追加销售
24-UB02
简单的
24-MB01
追加销售
24-WB03
简单的
24-MB01
追加销售
24-WB07
简单的
24-MB01
追加销售
24-WB04
简单的
1.
形象
形象
1.
假的
形象
小图像
缩略图
/m/b/mb01-blue-0.jpg
描述
p运动格斗行李袋是无与伦比的,无论在健身房、行李传送带上,还是在任何地方。它足够大,可以拖拉一个篮球或足球和一些有足够空间的运动鞋,是有地方可去的运动员的理想之选。/p
;
ul
;
liDual顶部手柄。/li
;
li可调节肩带。/li和#13;
L全长拉链。/li
;
liL 29英寸x宽13英寸x高11英寸/li
;
/保险商实验室
元标题
拳击袋
meta_关键字
拳击袋
元描述
拳击袋:运动型拳击袋是无与伦比的,无论在健身房、行李传送带上还是任何地方,都无法与之匹敌。它的体积足够大,可以携带篮球或足球以及一些有足够空间的运动鞋,非常适合那些没有场地的运动员
形象
/m/b/mb01-blue-0.jpg
小图像
/m/b/mb01-blue-0.jpg
缩略图
/m/b/mb01-blue-0.jpg
类别识别码
3.
4.
集装箱选项
集装箱2
所需选项
0
你有选择吗
0
图像标签
形象
小图像标签
形象
<customAttributes>
...
<item>
    <attributeCode>category_ids</attributeCode>
    <value>
        <xsd:string>3</xsd:string>
        <xsd:string>4</xsd:string>
    </value>
</item>
...
</customAttributes>