Magento肥皂错误

时间:2013-11-19 15:27:38

标签: magento soap wsdl

我正在开发一款应该集成Magento电子商务的iOS应用。 实际上我正在尝试将对象放入购物车,当我尝试这样做时,我的应用程序将此WSDL发送给服务器:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:Magento" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
   <SOAP-ENV:Body>
      <call>
         <sessionId xsi:type="xsd:string">e976c086bf862d23fcc98e59fb23b499</sessionId>
         <resourcePath xsi:type="xsd:string">cart_product.add</resourcePath>
         <args xsi:type="SOAP-ENC:Array">
            <item xsi:type="ns2:Map">
               <item>
                  <key xsi:type="xsd:string">quoteId</key>
                  <value xsi:type="xsd:int">85</value>
               </item>
               <item>
                  <key xsi:type="xsd:string">products</key>
                  <value xsi:type="SOAP-ENC:Array">
                     <item xsi:type="ns2:Map">
                        <item>
                           <key xsi:type="xsd:string">product_id</key>
                           <value xsi:type="xsd:string">1</value>
                        </item>
                        <item>
                           <key xsi:type="xsd:string">qty</key>
                           <value xsi:type="xsd:int">1</value>
                        </item>
                     </item>
                  </value>
               </item>
            </item>
         </args>
      </call>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

当我尝试运行WSDL

时,我尝试使用this extension for Google Chrome
<?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>1</faultcode>
            <faultstring>SQLSTATE[21000]: Cardinality violation: 1241 Operand should contain 1 column(s)</faultstring>
        </SOAP-ENV:Fault>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

我的请求有什么问题?任何人都可以帮助我吗?

1 个答案:

答案 0 :(得分:0)

现在解决了我发送的信息:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:Magento" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
   <SOAP-ENV:Body>
      <call>
         <sessionId xsi:type="xsd:string">38fd5af2c7fcfd55884b73ffded29225</sessionId>
         <resourcePath xsi:type="xsd:string">cart_product.add</resourcePath>
         <args xsi:type="SOAP-ENC:Array">
            <item xsi:type="xsd:int">142</item>
            <item xsi:type="SOAP-ENC:Array">
               <item xsi:type="ns2:Map">
                  <item>
                     <key xsi:type="xsd:string">product_id</key>
                     <value xsi:type="xsd:string">2</value>
                  </item>
                  <item>
                     <key xsi:type="xsd:string">qty</key>
                     <value xsi:type="xsd:int">1</value>
                  </item>
               </item>
            </item>
         </args>
      </call>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

我格式化了错误的请求,实际上,如果您比较2请求,您会看到差异:我发送了密钥“quoteId”,但没有必要。