Android ksoap webservice响应截断

时间:2012-09-14 08:58:05

标签: android web-services ksoap2 android-ksoap2

我正在使用kso​​ap库进行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 ...

如何获得完整回复?

2 个答案:

答案 0 :(得分:0)

Eclipse IDE在变量和监视调试字段中显示字符限制。我认为,您应该在 logcat 解析JSON <中打印出来/ strong>,因为你已经有了json格式。

答案 1 :(得分:0)

这可能会对你有所帮助 这里     http://tempuri.org/ 使用您的特定ipAddress进行更改 像

SOAP_ACTION =“http://172.27.212.2:8080/services/”+方法;