我正在使用ksoap庫進行web服務調用。以下是調用webserive的簡單功能。Android ksoap web服務響應截斷
try {
METHOD_NAME = method;
SOAP_ACTION = "http://tempuri.org/"+method;
URL = "http://172.27.212.2:8080/services/"+serviceName;
request = new SoapObject(NAMESPACE, METHOD_NAME);
soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
soapEnvelope.dotNet = true;
soapEnvelope.setOutputSoapObject(request);
androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION, soapEnvelope);
SoapPrimitive resultString = (SoapPrimitive) soapEnvelope.getResponse();
return resultString.toString();
} catch (Exception e) {
throw e;
}
Webservice方法返回一個json字符串。但在Eclipse中這個字符串被截斷。
我調試和截斷resultString是如下:
輸出:
{"menu":{ "Arrival": [
{
"traveldeskdetailid": 1968,
"traveldeskid": 4,
"AirlineName": "United Airlines",
"AirlineLogo": "UA1.gif",
"FlightNumber": "1239",
"Codeshare": "",
"City": "Newark",
"AirportName": "Newark Liberty International Airport",
"Delayed": "T",
"ScheduledTime": "8:29 PM",
"Remarks": "126 minutes late",
"RemarksWithTime": "Estimated 10:35 PM",
"Terminal": "3",
"Gate": "85",
"path": "http://dem5xqcn61lj8.cloudfront.net/logos/UA1.gif"
},
{ .. },{ .. },
{
"traveldeskdetailid": 1983,
"traveldeskid": 4,
"AirlineName": "Air Canada",
"AirlineLogo": "AC.gif",
"FlightNumber": "564",
"Codeshare": "",
"City": "Vancouver",
"AirportName": "Vancouver International Airport",
"Delayed": "T",
"ScheduledTime": "10:45 PM",
"Remarks": "19 minutes late",
"RemarksWithTime": "Estimated 11:04 PM",
"Terminal": "I",
"Gate": "73",
"path": "http://dem5xqcn61lj8.cloudfront.net/logos/AC.gif"
},
{
"traveldeskdetaili...
響應字符串截斷像
{ 「traveldeskdetaili ...
我如何獲得完整回覆?
我在logcat甚至在logcat字符串中顯示截斷的打印字符串。 – Priyank
響應字符串不被截斷!正如我所想,這不是有限的。請告訴我,你如何打印響應logcat?不幸的是,logcat是有限的。無論如何,給我的代碼處理響應,請 – JunR
我使用此代碼打印Log.e(「Json」,resultString.toString()); – Priyank