使用magento SOAP API的多重调用方法的正确方法是什么? [英] Whats correct way to use multicall method of magento SOAP API?

查看:87
本文介绍了使用magento SOAP API的多重调用方法的正确方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实现了两种调用magento方法的方法,一种是使用 http://sudzc.com/类,第二种是使用 http://www.wsdl2code.com/Pages/Home.aspx 类.但不能通过任何一种方式获取产品信息.

I have implemented two ways to call magento methods, first with http://sudzc.com/ classes and second with http://www.wsdl2code.com/Pages/Home.aspx classes. but not getting product info by either way.

请检查多对调用方法的两对请求和响应:-

Please check two pairs of request and response for multi call method :-

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(我认为这里的肥皂信封有问题,因为里面没有指定参数,让我知道如何纠正它)

Wsdl2code (I think there is problem with soap envelope here, because no param specified inside , let me know how to correct it)

请求:-

<?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>

推荐答案

经过大量的搜寻后,我设法通过查看

After lots of googling I have managed to solve this problem by looking at this post. It has an example project in it.

这篇关于使用magento SOAP API的多重调用方法的正确方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆