4

SOAP API を使用して、magento サーバーからデータを取得しています。
顧客リストを取得したいのですが、フィルターを渡して特定の顧客リストを取得したいと考えています。hashMap を使用していますが、シリアライゼーション例外が発生します。

私のコードは

{request = new SoapObject(NAMESPACE, "customerCustomerInfo");
            request.addProperty("sessionId", sessionId);
            HashMap<String, Object> filter=new HashMap<String, Object>();
            filter.put("customer_id", condition);
            request.addProperty("filters", filter);}

jsonobject 、単純な Arraylist も使用しましたが、同じ例外が発生しました。

4

2 に答える 2

3

「HashMap」を「HashTable」に変更して、「MarshalHashtable」をエンベロープに登録してみてください。

お気に入り:

SoapSerializationEnvelope env = new SoapSerializationEnvelope(SoapEnvelope.VER11);
androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.debug=true;
(new MarshalHashtable()).register(env);
// filter
Hashtable <String, String> filter=new Hashtable<String, String>();
filter.put("customer_id", "1");
request.addProperty("filter", filter);

からこの提案を得た

「パラメーターの配列を使用してリクエストを作成する」

https://code.google.com/p/ksoap2-android/wiki/CodingTipsAndTricks

于 2013-07-01T17:51:55.193 に答える