小编Sud*_*ali的帖子

SoapFault - faultcode:'1062'faultstring:'运送方式不可用'

您好我正在开发一个使用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());
Run Code Online (Sandbox Code Playgroud)

这将给我们这个输出


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());
Run Code Online (Sandbox Code Playgroud)

android soap ksoap2 android-ksoap2 magento-1.9

10
推荐指数
1
解决办法
646
查看次数

标签 统计

android ×1

android-ksoap2 ×1

ksoap2 ×1

magento-1.9 ×1

soap ×1