android – SoapFault – faultcode:’1062’faultstring:’运送方式不可用’

android – SoapFault – faultcode:’1062’faultstring:’运送方式不可用’,第1张

概述您好,我正在开发一个使用Magento作为后端的 Android应用程序,而我正在使用magento的SOAP webervice,我已将所有的产品,客户和客户地址信息添加到购物车中,但是当我尝试将运送方式添加到购物车我收到这个错误 SoapFault – faultcode:’1062’faultstring:’运送方式不可用’ 这是我正在尝试的代码,请帮我解决这个问题 SoapObject a 您好,我正在开发一个使用Magento作为后端的 Android应用程序,而我正在使用magento的SOAP webervice,我已将所有的产品,客户和客户地址信息添加到购物车中,但是当我尝试将运送方式添加到购物车我收到这个错误

SoapFault – faultcode:’1062’faultstring:’运送方式不可用’

这是我正在尝试的代码,请帮我解决这个问题

SoapObject availableShipPingMethods = new SoapObject(MAGENTO_nameSPACE,"shopPingCartShipPingList");availableShipPingMethods.addProperty("sessionID",sessionID);availableShipPingMethods.addProperty("quoteID",quoteID);env.setoutputSoapObject(availableShipPingMethods);androIDhttpTransport.call("",env);Object resultForAvailableShipPingMethods = env.getResponse();Log.d("AvailableShipPingMethods",resultForAvailableShipPingMethods.toString());

这将给我们这个输出

D / AvailableShipPingMethods:shopPingCartShipPingMethodEntityArray {item = shopPingCartShipPingMethodEntity {code = flatrate_error;载体= flatrate; carrIEr_Title =统一费率;价= 0; }; }

以下是将ShipPing方法设置为CartID的代码

SoapObject shipPingmethod = new SoapObject(MAGENTO_nameSPACE,"shopPingCartShipPingMethod"); shipPingmethod.addProperty("sessionID",sessionID); shipPingmethod.addProperty("quoteID",quoteID); shipPingmethod.addProperty("shipPingMethod","flatrate_error");//Code for Flatrate shipPing method and it is enabled in magento site env.setoutputSoapObject(shipPingmethod); androIDhttpTransport.call("",env); Log.d("shipPingMethod",shipPingmethod.toString()); Object resultforShipPingMethod = env.getResponse(); Log.d("ShipPingMethod",resultforShipPingMethod.toString());
解决方法 我知道答案已经太迟了,但可能会帮助未来的人…

问题在于magento soap v2的文档…当我通过wsdl链接时,我注意到一些如下所示:

<message name="shopPingCartShipPingMethodRequest"><part name="sessionID" type="xsd:string"/><part name="quoteID" type="xsd:int"/><part name="method" type="xsd:string"/><part name="storeID" type="xsd:string"/></message>

你可以看到,有属性方法.其实我们必须添加运送方式…
所以你必须更改ur代码如下…

SoapObject shipPingmethod = new SoapObject(MAGENTO_nameSPACE,"shopPingCartShipPingMethod");shipPingmethod.addProperty("sessionID",sessionID);shipPingmethod.addProperty("quoteID",quoteID);shipPingmethod.addProperty("method","flatrate_error");env.setoutputSoapObject(shipPingmethod);androIDhttpTransport.call("",env);Log.d("shipPingMethod",shipPingmethod.toString());Object resultforShipPingMethod = env.getResponse();Log.d("ShipPingMethod",resultforShipPingMethod.toString());
总结

以上是内存溢出为你收集整理的android – SoapFault – faultcode:’1062’faultstring:’运送方式不可用’全部内容,希望文章能够帮你解决android – SoapFault – faultcode:’1062’faultstring:’运送方式不可用’所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1131822.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存