为什么 magento API 会截断我的 SKU?

发布于 2024-12-02 02:55:10 字数 7085 浏览 1 评论 0原文

我通过 C# 的肥皂 API 将一些产品添加到 magento 店面。我遇到的问题是,当我将商品插入商店时,它会删除部分 SKU。有什么见解或建议吗?示例肥皂消息如下..

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <q1:catalogProductCreate xmlns:q1="urn:Magento">
        <sessionId xsi:type="xsd:string">**********************</sessionId>
        <type xsi:type="xsd:string">virtual</type>
        <set xsi:type="xsd:string">9</set>
        <sku xsi:type="xsd:string">C16933A</sku>
        <productData href="#id1"/>
    </q1:catalogProductCreate>
    <q2:catalogProductCreateEntity id="id1" xsi:type="q2:catalogProductCreateEntity" xmlns:q2="urn:Magento">
        <name xsi:type="xsd:string">Beautiful Every Time</name>
        <status xsi:type="xsd:string">1</status>
        <visibility xsi:type="xsd:string">4</visibility>
        <category_ids href="#id2"/><website_ids href="#id3"/>
        <price xsi:type="xsd:string">1.99</price>
        <tax_class_id xsi:type="xsd:string">2</tax_class_id>
        <additional_attributes href="#id4"/>
        <stock_data href="#id5"/>
    </q2:catalogProductCreateEntity>
    <q3:Array id="id2" q3:arrayType="xsd:string[1]" xmlns:q3="http://schemas.xmlsoap.org/soap/encoding/">
        <Item>10</Item>
    </q3:Array>
    <q4:Array id="id3" q4:arrayType="xsd:string[3]" xmlns:q4="http://schemas.xmlsoap.org/soap/encoding/">
        <Item>1</Item>
        <Item>2</Item>
        <Item>3</Item>
    </q4:Array>
    <q5:Array id="id4" q5:arrayType="q6:associativeEntity[16]" xmlns:q5="http://schemas.xmlsoap.org/soap/encoding/" xmlns:q6="urn:Magento">
        <Item href="#id6"/>
        <Item href="#id7"/>
        <Item href="#id8"/>
        <Item href="#id9"/>
        <Item href="#id10"/>
        <Item href="#id11"/>
        <Item href="#id12"/>
        <Item href="#id13"/>
        <Item href="#id14"/>
        <Item href="#id15"/>
        <Item href="#id16"/>
        <Item href="#id17"/>
        <Item href="#id18"/>
        <Item href="#id19"/>
        <Item href="#id20"/>
        <Item href="#id21"/>
    </q5:Array>
    <q7:catalogInventoryStockItemUpdateEntity id="id5" xsi:type="q7:catalogInventoryStockItemUpdateEntity" xmlns:q7="urn:Magento">
        <qty xsi:type="xsd:string">0</qty>
    </q7:catalogInventoryStockItemUpdateEntity>
    <q8:associativeEntity id="id6" xsi:type="q8:associativeEntity" xmlns:q8="urn:Magento">
        <key xsi:type="xsd:string">artist</key>
        <value xsi:type="xsd:string">Lee Brice</value>
    </q8:associativeEntity>
    <q9:associativeEntity id="id7" xsi:type="q9:associativeEntity" xmlns:q9="urn:Magento">
        <key xsi:type="xsd:string">publisher</key>
        <value xsi:type="xsd:string"/>
    </q9:associativeEntity><q10:associativeEntity id="id8" xsi:type="q10:associativeEntity" xmlns:q10="urn:Magento">
        <key xsi:type="xsd:string">writer</key>
        <value xsi:type="xsd:string"/>
    </q10:associativeEntity>
    <q11:associativeEntity id="id9" xsi:type="q11:associativeEntity" xmlns:q11="urn:Magento">
        <key xsi:type="xsd:string">key_signature</key>
        <value xsi:type="xsd:string">B</value>
    </q11:associativeEntity>
    <q12:associativeEntity id="id10" xsi:type="q12:associativeEntity" xmlns:q12="urn:Magento">
        <key xsi:type="xsd:string">custom_cd_allowed</key>
        <value xsi:type="xsd:string">1</value>
    </q12:associativeEntity>
    <q13:associativeEntity id="id11" xsi:type="q13:associativeEntity" xmlns:q13="urn:Magento">
        <key xsi:type="xsd:string">hardware_available</key>
        <value xsi:type="xsd:string">1</value>
    </q13:associativeEntity><q14:associativeEntity id="id12" xsi:type="q14:associativeEntity" xmlns:q14="urn:Magento">
        <key xsi:type="xsd:string">digital_download_allowed</key>
        <value xsi:type="xsd:string">0</value>
    </q14:associativeEntity>
    <q15:associativeEntity id="id13" xsi:type="q15:associativeEntity" xmlns:q15="urn:Magento">
        <key xsi:type="xsd:string">msrp</key>
        <value xsi:type="xsd:string">0</value>
    </q15:associativeEntity>
    <q16:associativeEntity id="id14" xsi:type="q16:associativeEntity" xmlns:q16="urn:Magento">
        <key xsi:type="xsd:string">mix_type</key>
        <value xsi:type="xsd:string">13</value>
    </q16:associativeEntity>
    <q17:associativeEntity id="id15" xsi:type="q17:associativeEntity" xmlns:q17="urn:Magento">
        <key xsi:type="xsd:string">track_length</key>
        <value xsi:type="xsd:string">03:39</value>
    </q17:associativeEntity>
    <q18:associativeEntity id="id16" xsi:type="q18:associativeEntity" xmlns:q18="urn:Magento">
        <key xsi:type="xsd:string">file_type</key>
        <value xsi:type="xsd:string">98</value>
    </q18:associativeEntity>
    <q19:associativeEntity id="id17" xsi:type="q19:associativeEntity" xmlns:q19="urn:Magento">
        <key xsi:type="xsd:string">file_size</key>
        <value xsi:type="xsd:string">40125168</value>
    </q19:associativeEntity><q20:associativeEntity id="id18" xsi:type="q20:associativeEntity" xmlns:q20="urn:Magento">
        <key xsi:type="xsd:string">genre</key>
        <value xsi:type="xsd:string">10</value>
    </q20:associativeEntity>
    <q21:associativeEntity id="id19" xsi:type="q21:associativeEntity" xmlns:q21="urn:Magento">
        <key xsi:type="xsd:string">vocal_type</key>
        <value xsi:type="xsd:string">120</value>
    </q21:associativeEntity>
    <q22:associativeEntity id="id20" xsi:type="q22:associativeEntity" xmlns:q22="urn:Magento">
        <key xsi:type="xsd:string">has_male</key>
        <value xsi:type="xsd:string">1</value>
    </q22:associativeEntity>
    <q23:associativeEntity id="id21" xsi:type="q23:associativeEntity" xmlns:q23="urn:Magento">
        <key xsi:type="xsd:string">has_female</key>
        <value xsi:type="xsd:string">0</value>
    </q23:associativeEntity>
</s:Body>

正如您所看到的,SKU 设置为“C16933A”,但是,当服务调用返回并且我在商店管理面板中查找该商品时,结果为

插入结果

I'm adding some products though to a magento store front through the soap API from C#. The problem I am having is when I am inserting items into the store it is removing part of the SKU. Any insight or suggestions? Example soap message follows..

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <q1:catalogProductCreate xmlns:q1="urn:Magento">
        <sessionId xsi:type="xsd:string">**********************</sessionId>
        <type xsi:type="xsd:string">virtual</type>
        <set xsi:type="xsd:string">9</set>
        <sku xsi:type="xsd:string">C16933A</sku>
        <productData href="#id1"/>
    </q1:catalogProductCreate>
    <q2:catalogProductCreateEntity id="id1" xsi:type="q2:catalogProductCreateEntity" xmlns:q2="urn:Magento">
        <name xsi:type="xsd:string">Beautiful Every Time</name>
        <status xsi:type="xsd:string">1</status>
        <visibility xsi:type="xsd:string">4</visibility>
        <category_ids href="#id2"/><website_ids href="#id3"/>
        <price xsi:type="xsd:string">1.99</price>
        <tax_class_id xsi:type="xsd:string">2</tax_class_id>
        <additional_attributes href="#id4"/>
        <stock_data href="#id5"/>
    </q2:catalogProductCreateEntity>
    <q3:Array id="id2" q3:arrayType="xsd:string[1]" xmlns:q3="http://schemas.xmlsoap.org/soap/encoding/">
        <Item>10</Item>
    </q3:Array>
    <q4:Array id="id3" q4:arrayType="xsd:string[3]" xmlns:q4="http://schemas.xmlsoap.org/soap/encoding/">
        <Item>1</Item>
        <Item>2</Item>
        <Item>3</Item>
    </q4:Array>
    <q5:Array id="id4" q5:arrayType="q6:associativeEntity[16]" xmlns:q5="http://schemas.xmlsoap.org/soap/encoding/" xmlns:q6="urn:Magento">
        <Item href="#id6"/>
        <Item href="#id7"/>
        <Item href="#id8"/>
        <Item href="#id9"/>
        <Item href="#id10"/>
        <Item href="#id11"/>
        <Item href="#id12"/>
        <Item href="#id13"/>
        <Item href="#id14"/>
        <Item href="#id15"/>
        <Item href="#id16"/>
        <Item href="#id17"/>
        <Item href="#id18"/>
        <Item href="#id19"/>
        <Item href="#id20"/>
        <Item href="#id21"/>
    </q5:Array>
    <q7:catalogInventoryStockItemUpdateEntity id="id5" xsi:type="q7:catalogInventoryStockItemUpdateEntity" xmlns:q7="urn:Magento">
        <qty xsi:type="xsd:string">0</qty>
    </q7:catalogInventoryStockItemUpdateEntity>
    <q8:associativeEntity id="id6" xsi:type="q8:associativeEntity" xmlns:q8="urn:Magento">
        <key xsi:type="xsd:string">artist</key>
        <value xsi:type="xsd:string">Lee Brice</value>
    </q8:associativeEntity>
    <q9:associativeEntity id="id7" xsi:type="q9:associativeEntity" xmlns:q9="urn:Magento">
        <key xsi:type="xsd:string">publisher</key>
        <value xsi:type="xsd:string"/>
    </q9:associativeEntity><q10:associativeEntity id="id8" xsi:type="q10:associativeEntity" xmlns:q10="urn:Magento">
        <key xsi:type="xsd:string">writer</key>
        <value xsi:type="xsd:string"/>
    </q10:associativeEntity>
    <q11:associativeEntity id="id9" xsi:type="q11:associativeEntity" xmlns:q11="urn:Magento">
        <key xsi:type="xsd:string">key_signature</key>
        <value xsi:type="xsd:string">B</value>
    </q11:associativeEntity>
    <q12:associativeEntity id="id10" xsi:type="q12:associativeEntity" xmlns:q12="urn:Magento">
        <key xsi:type="xsd:string">custom_cd_allowed</key>
        <value xsi:type="xsd:string">1</value>
    </q12:associativeEntity>
    <q13:associativeEntity id="id11" xsi:type="q13:associativeEntity" xmlns:q13="urn:Magento">
        <key xsi:type="xsd:string">hardware_available</key>
        <value xsi:type="xsd:string">1</value>
    </q13:associativeEntity><q14:associativeEntity id="id12" xsi:type="q14:associativeEntity" xmlns:q14="urn:Magento">
        <key xsi:type="xsd:string">digital_download_allowed</key>
        <value xsi:type="xsd:string">0</value>
    </q14:associativeEntity>
    <q15:associativeEntity id="id13" xsi:type="q15:associativeEntity" xmlns:q15="urn:Magento">
        <key xsi:type="xsd:string">msrp</key>
        <value xsi:type="xsd:string">0</value>
    </q15:associativeEntity>
    <q16:associativeEntity id="id14" xsi:type="q16:associativeEntity" xmlns:q16="urn:Magento">
        <key xsi:type="xsd:string">mix_type</key>
        <value xsi:type="xsd:string">13</value>
    </q16:associativeEntity>
    <q17:associativeEntity id="id15" xsi:type="q17:associativeEntity" xmlns:q17="urn:Magento">
        <key xsi:type="xsd:string">track_length</key>
        <value xsi:type="xsd:string">03:39</value>
    </q17:associativeEntity>
    <q18:associativeEntity id="id16" xsi:type="q18:associativeEntity" xmlns:q18="urn:Magento">
        <key xsi:type="xsd:string">file_type</key>
        <value xsi:type="xsd:string">98</value>
    </q18:associativeEntity>
    <q19:associativeEntity id="id17" xsi:type="q19:associativeEntity" xmlns:q19="urn:Magento">
        <key xsi:type="xsd:string">file_size</key>
        <value xsi:type="xsd:string">40125168</value>
    </q19:associativeEntity><q20:associativeEntity id="id18" xsi:type="q20:associativeEntity" xmlns:q20="urn:Magento">
        <key xsi:type="xsd:string">genre</key>
        <value xsi:type="xsd:string">10</value>
    </q20:associativeEntity>
    <q21:associativeEntity id="id19" xsi:type="q21:associativeEntity" xmlns:q21="urn:Magento">
        <key xsi:type="xsd:string">vocal_type</key>
        <value xsi:type="xsd:string">120</value>
    </q21:associativeEntity>
    <q22:associativeEntity id="id20" xsi:type="q22:associativeEntity" xmlns:q22="urn:Magento">
        <key xsi:type="xsd:string">has_male</key>
        <value xsi:type="xsd:string">1</value>
    </q22:associativeEntity>
    <q23:associativeEntity id="id21" xsi:type="q23:associativeEntity" xmlns:q23="urn:Magento">
        <key xsi:type="xsd:string">has_female</key>
        <value xsi:type="xsd:string">0</value>
    </q23:associativeEntity>
</s:Body>

As you can see the SKU is set to "C16933A", however, when the service call returns and I lookup the item in the store admin panel the result is

Result of Insert

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

层林尽染 2024-12-09 02:55:10

我能够解决我的问题,我要做的就是向 AssociateArray 添加另一个项目并再次设置 sku,我认为这是 magento API 中的一个错误,但至少我能够找到解决方法。

I was able to resolve my issue, what I had to do was add another item to the associatearray and set the sku again, I think this is a bug in the magento API, but at least I was able to find a work around for it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文