Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HttpTransportSe.call() method taking up to a minute for web service call

I am calling a web service from my Android application. I have many different calls to this service all through the application and every one of them is returning data in less than a second, except for one. One of my calls can take up to a minute to return the data even though the actual web service call is near instantaneous. The problem occurs with the line:

transport.call(SOAP_ACTION, soapEnvelope);

That is called and the value is returned from the web service almost instantaneously. But it can take up to a minute to reach the next line:

SoapObject result = (SoapObject) soapEnvelope.bodyIn;

What is happening between the web service returning data and the app hitting the next line (above)? Is there a way to reduce this delay? Is there anything simple to check?

like image 371
anothershrubery Avatar asked Nov 04 '22 01:11

anothershrubery


1 Answers

Is there a way to reduce this delay? Is there anything simple to check?

The only way to know is to measure the difference in time in various areas. For a SOAP web service call these are the times to measure.

Client side time

Client Application code -> Request Handlers -> Request Serialization -> Request dispatch -> HTTP Transport -> Server side

Server side time

Receive HTTP Request -> De-serialization -> Application code -> Response handlers -> Serialization -> Dispatch -> HTTP Transport

The blockage is usually in the application code, handlers and the network. Measure those and you can find where the time is spent.

  • To measure CPU time taken by your application code and handlers use a profiler. I'd recommend Jprofiler.
  • To measure network time, ping the target server and also use a web debugging proxy like Charles. It can tell you the time spent by the request on the network.
like image 184
Deepak Bala Avatar answered Nov 15 '22 00:11

Deepak Bala