2013-11-28 21 views
1

我已經實現了兩種調用magento方法的方法,首先使用http://sudzc.com/類,其次使用http://www.wsdl2code.com/Pages/Home.aspx類。但無法通過任何方式獲取產品信息。使用magento SOAP API的多重方法有什麼正確的方法?

請檢查2對請求和響應多呼叫方法: -

SUDZC

請求: -

<?xml version="1.0" encoding="UTF-8"?> 
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
<soap:Body> 
    <multiCall> 
    <sessionId>b543e92c12944a5512c624a4944423d8</sessionId> 
    <calls>(
"catalog_product.info" 
    )</calls> 
    <options>(
    productId, 
    5 
    )</options> 
    </multiCall> 
</soap:Body> 
</soap:Envelope> 

響應: -

<?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: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> 
    <ns1:multiCallResponse> 
    <multiCallReturn SOAP-ENC:arrayType="xsd:ur-type[0]" xsi:type="ns1:FixedArray" /> 
    </ns1:multiCallResponse> 
</SOAP-ENV:Body> 
</SOAP-ENV:Envelope> 

Wsdl2code(我認爲這裏有肥皂信封存在問題,因爲裏面沒有指定參數,讓我知道ho w至更正)

請求: -

<?xml version="1.0" encoding="UTF-8"?> 
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
<soap:Body> 
    <multiCall xmlns="urn:Magento"> 
    <sessionId>b543e92c12944a5512c624a4944423d8</sessionId> 
    <calls> 
     <MagentoService> 
      <SoapVersion>Default</SoapVersion> 
      <AllowAutoRedirect>0</AllowAutoRedirect> 
      <EnableDecompression>0</EnableDecompression> 
      <UnsafeAuthenticatedConnectionSharing>0</UnsafeAuthenticatedConnectionSharing> 
      <UseDefaultCredentials>0</UseDefaultCredentials> 
      <PreAuthenticate>0</PreAuthenticate> 
      <Url>http://mediaplus.co.za/api/soap/?wsdl/multiCall</Url> 
      <Timeout>0</Timeout> 
     </MagentoService> 
    </calls> 
    </multiCall> 
</soap:Body> 
</soap:Envelope> 

響應: -

<?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>SOAP-ENV:Server</faultcode> 
    <faultstring>Cannot use object of type stdClass as array</faultstring> 
    </SOAP-ENV:Fault> 
</SOAP-ENV:Body> 
</SOAP-ENV:Envelope> 

回答

1

經過大量的谷歌搜索我已經設法通過看this post來解決這個問題的。 它有一個示例項目。

相關問題