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:’运送方式不可用’所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)