1

我正在使用 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 并且根据该问题也完成了......但没有成功。

请帮助我...提前谢谢...:)

4

0 回答 0