它总是只在android中返回已完成的订单。
如何在android中编写这个php代码来获取结果
$filters = array(array(
'filter' => array(
array(
'key' => 'status',
'value' => 'pending'
))));
发送肥皂客户端
request = new SoapObject(NAMESPACE, "salesOrderList");
request.addProperty("sessionId",sessionId );
request.addProperty("filters", filters);
答案 0 :(得分:1)
您可以使用android
中的ksoap2-android库执行以下操作// NAMESPACE - specify your namespace
// sessionId - get by calling the login web service
// SALES_ORDER_LIST - web service to get sales order list
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = false;
envelope.xsd = SoapSerializationEnvelope.XSD;
envelope.enc = SoapSerializationEnvelope.ENC;
SoapObject entity = new SoapObject(NAMESPACE, "associativeEntity");
entity.addProperty("key", "status");
entity.addProperty("value", "processing");
SoapObject filter = new SoapObject(NAMESPACE, "associativeArray");
array.addProperty("associativeEntity", entity);
SoapObject filters = new SoapObject(NAMESPACE, "filters");
filter.addProperty("filter", filters);
SoapObject salesOrderList = new SoapObject(NAMESPACE, "salesOrderList");
requestCart.addProperty("sessionId", sessionId);
requestCart.addProperty("filters", filters);
env.setOutputSoapObject(salesOrderList);
androidHttpTransport.call(SALES_ORDER_LIST, envelope);
result = env.getResponse();
Log.d("List of Products", result.toString());
答案 1 :(得分:0)
使用ksoap2-android库对magento soap进行复杂过滤
class func changeLanguageForceFully(currLan : String){
let langCultureCode: String = currLan
let defaults = NSUserDefaults.standardUserDefaults()
defaults.setObject([langCultureCode], forKey: "AppleLanguages")
defaults.synchronize()
}