Re: Invoking Web Service from WinForm App VERY slow first call

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Mar 27, 6:36 am, Jim Owen <j...@xxxxxxxxxxxxx> wrote:
Thanks for the reply.

We've narrowed it down to something that is occurring on our client side but
have not totally sorted it out. It appears that there is significant
overhead when it is first invoked, but what is generated appears to be cached
for some period after generation.

To test this, we wrote a small console app that simply invokes the web
service through a class then prints out the elapsed time on the console.
When the exe is first executed, the entire process requires 15 - 18 seconds.
Executing the same executable a second time cuts the elapsed time to 3-4
seconds. Executing again produces the same results. However, if you wait 10
minutes or so and execute the program again, elapsed time again shoots up to
15-18 seconds.

There's obviously initialization going on behind the scene that we're not
seeing. We'd like to eliminate that init when first called or at least
minimize it.

Thanks,
Jim

"Jeff" wrote:
I had a similar problem with .NET Remoting in the past. This may or may not
be the same issue for you. In our case the remote object was loading a lot of
data as it was initialized. It turns out that with .NET Remoting the remote
object is not actually created until the client application invokes a method
or property. So the client program would start up and create the proxy and
you think everything is great. Then when a user tried to invoke it they had
to wait for intitialization. It was really a matter of understanding the
lifetime of a remote object and getting the architecture correct.

I would start by looking at the initialization code and finding out if that
is the slow down.

"Jim Owen" wrote:

Hi,
We have been putting together a Win Forms application that consumes a web
service to obtain item information for a client. We've found that the first
call to the web service from the application, no matter what the call is,
takes way, way too long. We've timed it at over 15 seconds, but the second
call from within the same app takes 4-500 milliseconds.

We've found a couple of references to things that might decrease the initial
time, but nothing definite.

Anyone have suggestions on handling this? The classes handling the web
service calls were written in VB.NET using 3.5 framework and using Web
Services references rather than Service References. Using VS 2008.

Thanks,

Jim

it's not the server rebuilding is it? IIS isn't shutting down and
restarting? you could recycle the app pool and see if it gives the
same lag after the recycle.

you could also try invoking the same web service from another app on
another machine, see what that does.
.



Relevant Pages

  • Re: Invoking Web Service from WinForm App VERY slow first call
    ... We've narrowed it down to something that is occurring on our client ... Executing the same executable a second time cuts the elapsed time to ... Executing again produces the same results. ... This sounds like the serialization assemblies being created at runtime. ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Invoking Web Service from WinForm App VERY slow first call
    ... references are still defined as web references rather that service references. ... We've narrowed it down to something that is occurring on our client ... we wrote a small console app that simply invokes the web ... Executing again produces the same results. ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Invoking Web Service from WinForm App VERY slow first call
    ... We've narrowed it down to something that is occurring on our client ... we wrote a small console app that simply invokes the web ... Executing the same executable a second time cuts the elapsed time to ... Executing again produces the same results. ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Invoking Web Service from WinForm App VERY slow first call
    ... This is a remote service with dozens of users ... service through a class then prints out the elapsed time on the console. ... Executing again produces the same results. ... object is not actually created until the client application invokes a method ...
    (microsoft.public.dotnet.framework.webservices)
  • RE: Invoking Web Service from WinForm App VERY slow first call
    ... we wrote a small console app that simply invokes the web ... service through a class then prints out the elapsed time on the console. ... Executing again produces the same results. ... object is not actually created until the client application invokes a method ...
    (microsoft.public.dotnet.framework.webservices)