如何更新3D购物车产品选项库存

时间:2014-06-05 15:25:55

标签: xml shopping-cart soap1.2

如何使用Advanced SOAP 1.2 API的runQuery命令更新3D购物车的产品选项库存?

要明确,我不是指使用Basic SOAP 1.2 API公开的updateProductInventory

以下是我的请求,没有标题并使用虚拟商店和密钥。

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <runQuery xmlns="http://3dcart.com/">
            <storeUrl>mystore.3dcartstores.com</storeUrl>
            <userKey>12345678901234567890123456789012</userKey>
            <sqlStatement> update options_Advanced SET AO_Stock = 117 WHERE AO_Suffix = '1346106BLK'</sqlStatement>
            <callBackURL/>
        </runQuery>
    </soap:Body>
</soap:Envelope>

我收到以下神秘的回复。

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <runQueryResponse xmlns="http://3dcart.com/">
            <runQueryResult>
                <runQueryResponse xmlns="">
                    <Error>
                        <Id>99</Id>
                        <Description>No value given for one or more required parameters.</Description>
                    </Error>
                </runQueryResponse>
            </runQueryResult>
        </runQueryResponse>
    </soap:Body>
</soap:Envelope>

1 个答案:

答案 0 :(得分:0)

在咨询3D购物车支持后,我找到了以下答案。

  

试试这个:update options_Advanced SET AO_Stock = 117 WHERE AO_Sufix =&#39; 1346106BLK&#39;   不幸的是,我们的数据库字段中有拼写错误。因此,您应该使用AO_Sufix

而不是AO_Suffix

database documentation仍然错误地将列标识为AO_Suffix

正确的请求如下:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <runQuery xmlns="http://3dcart.com/">
            <storeUrl>mystore.3dcartstores.com</storeUrl>
            <userKey>12345678901234567890123456789012</userKey>
            <sqlStatement> update options_Advanced SET AO_Stock = 117 WHERE AO_Sufix = '1346106BLK'</sqlStatement>
            <callBackURL/>
        </runQuery>
    </soap:Body>
</soap:Envelope>