我在android中使用SOAP解析。
实际上我的问题是,当我尝试将日期作为参数传递时,它会抛出doubleID异常。
我的代码如下:
public SoapPrimitive getUserList() {
SoapPrimitive result = null;
String isNewTask = null;
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
String startTime = "02-06-2013";
SimpleDateFormat dateFormat = new SimpleDateFormat("MM-dd-yyyy");
try {
date1 = dateFormat.parse(startTime);
System.out.println(date1);
}
catch (ParseException e1) {
// TODO Auto-generated catch block
Log.i("ParseException",e1.getMessage());
}
request.addProperty("fromDate", date1);
request.addProperty("toDate", date1);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
new MarshalDate().register(envelope);
AndroidHttpTransport transport = new AndroidHttpTransport(URL);
transport.debug = true;
try {
transport.call(SOAP_ACTION, envelope);
result = (SoapPrimitive)envelope.getResponse();
int count = request.getPropertyCount();
String c = String.valueOf(count);
Log.i("Count Value",c);
isNewTask = result.toString();
Log.i("Test", "------------------------------" + isNewTask);
}
catch (IOException e) {
Log.i("IOException",e.getMessage());
}
catch (XmlPullParserException e) {
Log.i("XmlPullParserException",e.getMessage());
}
return result;
}
我已按照问题kSOAP2 double ID exception 并且根据那个也做了......但没有获得成功。
请帮助我......提前致谢... :)