如何处理Ksoap2的这个例外?

时间:2016-04-13 03:09:40

标签: android ksoap2

这是我从webservice获取响应的代码:

     public static DDayDetailModel getDDayDetailModel(long ddayId, boolean isFromDDayList) {
            DDayDetailModel ddayDetailModel = new DDayDetailModel();
            SoapObject request = null;

            request = new SoapObject(NAMESPACE, METHOD_NAME_GET_DETAIL);
            request.addProperty("sessionId", mPref.getCurrentMobileSessionId());
            request.addProperty("languageCode", LanguageUtils.getPhoneLanguage());
            request.addProperty("timeZoneOffset", DeviceUtilities.getTimeZoneOffset());
            request.addProperty("dayNo", ddayId);

            SoapSerializationEnvelope soapEnvelop = null;
            soapEnvelop = new SoapSerializationEnvelope(SoapEnvelope.VER12);
            soapEnvelop.dotNet = true;
            soapEnvelop.setOutputSoapObject(request);

            HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);

            try {
                androidHttpTransport.call(SOAP_ACTION_GET_DETAIL, soapEnvelop);
                SoapObject response = (SoapObject) soapEnvelop.getResponse();
                SoapObject soapList = (SoapObject) response.getProperty("data");

                //Get title
                String title = soapList.getProperty("Title").toString();
                ddayDetailModel.setTitle(title);
                .....
}

我的应用程序大部分时间都可正常运行,但有时我会遇到此异常

  Caused by: java.lang.RuntimeException: illegal property: data

真的很奇怪。请告诉我如何处理此异常。谢谢!

0 个答案:

没有答案