0

我正在使用 ksoap 库进行 Web 服务调用。下面是一个调用 webserver 的简单函数。

 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 字符串。但是在日食中,这个字符串被截断了。
我调试和截断的结果字符串如下:

OutPut:

{"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...

响应字符串被截断

{“旅游桌详细...

我怎样才能得到完整的回应?

4

2 回答 2

0

this may helps you here http://tempuri.org/ change with your specific ipAddress like

SOAP_ACTION = "http://172.27.212.2:8080/services/"+method;

于 2012-09-14T09:13:06.823 回答
0

Eclipse IDE 在 vars 和 watch 调试字段中显示的字符有限制。我认为,您应该在logcat解析 JSON中将其打印出来,因为您已经拥有 json 格式。

于 2012-09-14T09:10:39.840 回答