androidweb-servicessoapksoap2roundtrip

How to get round trip time while calling SOAP webservice using KSOAP in android?


I am developing an Android application which rely on .NET web service for dynamic data. So, to communicate with SOAP web methods i am using KSOAP2 third party API. It is working fine. but i need to get the round trip time for each web service call using KSOAP2 because my application running slow when compared with same application running in iPhone. So I need to know the RTT to improve the performance of my Android application.


Solution

  • You could wrap the call to .NET service around basic time measuring technique and add the response time in logs for later inspection. Something like this...

    long start = System.currentTimeMillis();
    <...call to .NET server ...>
    System.out.println("Time taken: "+ ((System.currentTimeMillis() - start)) + "ms");