リクエストプロパティをどのようにフォーマットしても、次のようになります。
Cannot Serialize: [int, int, int]
エラー。他に何を試すべきかわかりません。私はもう試した:
ArrayList<Integer>, int[], Vector<Integer>, List<Integer>
これらのどれも機能しませんでした。最も近いのは Vector でした。Vector オブジェクトは正常にシリアル化されているように見えましたが、それを Web サービス メソッドに送信すると、次のエラーが発生しました。
java.lang.RuntimeError Mismatched types
はい、メソッドの入力パラメータを Vector に変更し、同じタイプの Vector をインポートしたことを確認しました。
これは私の Web サービスであり、私のアプリなので、すべてを網羅しています。アプリと WS のいずれの部分も喜んで変更します。何かアイデアがあれば教えてください。これは、Web サービスのリクエストを作成する方法です。
これは、Vector を使用しようとしている完全な方法です。
public ArrayList<Contacts> getLocationslist(Vector<Integer> list){
ArrayList<Contacts> contacts = new ArrayList<Contacts>();
String SOAP_ACTION = "urn:getLocationsList";
String METHOD_NAME = "getLocationsList";
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("arg0", list);
SoapSerializationEnvelope envelope =
new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
try {
androidHttpTransport.call(SOAP_ACTION, envelope);
int i = 0;
SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;
while (i < resultsRequestSOAP.getPropertyCount()){
Contacts cont = new Contacts();
try {
Ksoap2ResultParser.parseBusinessObject(resultsRequestSOAP.getProperty(i).toString(), cont);
} catch (NumberFormatException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
contacts.add(cont);
i = i + 1;
}
} catch (Exception e) {
e.printStackTrace();
}
return contacts;
}
私はあなたを頼りにしていますSO!! 前もって感謝します。