R – First call to web service is slow; consumed by compact framework win app

compact-frameworkweb services

i have a .net 2.0 web service running on IIS 7.0.

i consume this service from a compact framework written application (CF 2.0).
The first call takes 13 seconds, all subsequent calls are super fast (under 1 sec). No data is cached.

Any ideas how to solve this?

Best Answer

The first call under a CF application is when all of the proxy objects on the device are created. So even if the objects, etc on the server are already spun up, the first call from each device is going to be substantially slower than any subsequent call.

A common workaround for this is to have your service expose some stub method (it can do absolutely nothing if you want) and when your application starts up, spawn a worker thread that calls this stub. This will create the service proxy objects in the background for you so when your app actually makes a call out to the service, everything is ready.

Related Topic