我正在使用ksoap库进行webservice调用。以下是调用webserive的简单功能。
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 ...
如何获得完整回复?
答案 0 :(得分:0)
Eclipse IDE在变量和监视调试字段中显示字符限制。我认为,您应该在 logcat 或解析JSON <中打印出来/ strong>,因为你已经有了json格式。
答案 1 :(得分:0)
SOAP_ACTION =“http://172.27.212.2:8080/services/”+方法;