0

I'm using ksoap library for webservice call. Below is a simple function for calling 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 method returns a json string. But in eclipse this string getting truncated.
I debugged and truncated resultString is as below:

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

Response string is truncate like

{ "traveldeskdetaili...

How can I get full response?

Priyank
  • 1,219
  • 11
  • 30

2 Answers2

0

Eclipse IDE has a limit of chars showing in the vars and watch debug fields. I think, you should print it out in logcat or parse JSON, because you already have json-format.

JunR
  • 202
  • 1
  • 6
  • I have print string in logcat even in logcat string shows truncate. – Priyank Sep 14 '12 at 09:44
  • response string is NOT truncate! It is not limited, as I think. Plese show me, how do you print responce to logcat? Unfortunately, logcat is limited. Anyway, give me code processing responce, please – JunR Sep 14 '12 at 10:39
  • I use this code for print Log.e("Json", resultString.toString()); – Priyank Sep 14 '12 at 10:46
  • Think you can split your too long String into many strings into array and then send it into logcat by each item. Define each element's LENGTH, and get substring from long responce string. Understood? :) – JunR Sep 14 '12 at 10:50
  • This string I'm getting from server side, How can I split there? – Priyank Sep 14 '12 at 10:59
  • 1
    I am telling you to split it with substring(From,To) only to look throw the all responce first of all. And then to parse JSON you don't have to SEE full responce. Responce is NOT truncate! You'll see that if use responced format of json and parce it. JSON-object, Json-array, etc. – JunR Sep 14 '12 at 11:35
  • Problem was in parsing json string. I had put wrong root element name in `getJSONArray` method and moreover when I debug and print log I found string is truncate. so json parse error was override by truncate issue and because of just single mistake couple of hours are spoiled. Anyways thank you. – Priyank Sep 14 '12 at 18:20
  • Okay! Could you post here your solution? – JunR Sep 15 '12 at 06:20
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;

Ankitkumar Makwana
  • 3,475
  • 3
  • 19
  • 45
  • I think where you pointing me its not the actual problem because I can make successful web service call. Issue is response string is truncate. !! – Priyank Sep 14 '12 at 09:46