473,388 Members | 996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

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

Hi John,

Hopefully this post will find its way back to you - or perhaps be answered
by someone else. As I mentioned in my last post on the earlier portion of
this thread, changing the serialization settings for the build handled the
initial slows we encountered when invoking the web service.

Since that time, we ported the original VB.net code over to C# - this was
done to make it cleaner easier to include the project in the rest of the C#
solution.

The problem is that the initial slows have re-appeared despite ensuring
the serialization option in the project were set to "On" and trying every
combination that we could think of.

We're using VS2008 Team Suite with the 3.5 framework. The web
references are still defined as web references rather that service references.

Any ideas what this might be at this time?

Regards,

Jim

"John Saunders [MVP]" wrote:
>

"Jim Owen" <ji**@online.nospamwrote in message
news:25**********************************@microsof t.com...
As far as we can tell, no. This is a remote service with dozens of users
invoking services continually. There does not appear to be issues with
other
clients. (We have three different development locations, each with the
same
issue, so it does not appear to be network or connection related.)

We have not yet found the exact cause, but we're looking into the
initialization process.

Jim

"densial" wrote:
On Mar 27, 6:36 am, Jim Owen <j...@online.nospamwrote:
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.

This sounds like the serialization assemblies being created at runtime. Try
changing the settings of the Serialization Assembly dropdown at the bottom
of the Build pane of the properties window for the project.
--
--------------------------------------------------------------------------------
John Saunders | MVP – Windows Server System – Connected System Developer
Jun 27 '08 #1
2 5534
On May 4, 4:14*pm, Jim Owen <j...@online.nospamwrote:
Hi John,

* Hopefully this post will find its way back to you - or perhaps be answered
by someone else. *As I mentioned in my last post on the earlier portion of
this thread, changing the serialization settings for the build handled the
initial slows we encountered when invoking the web service.

* Since that time, we ported the original VB.net code over to C# - this was
done to make it cleaner easier to include the project in the rest of the C#
solution.

* The problem is that the initial slows have re-appeared despite ensuring
the serialization option in the project were set to "On" and trying every
combination that we could think of.

* We're using VS2008 Team Suite with the 3.5 framework. * *The web
references are still defined as web references rather that service references.

* Any ideas what this might be at this time?

* Regards,

* Jim

"John Saunders [MVP]" wrote:
"Jim Owen" <j...@online.nospamwrote in message
news:25**********************************@microsof t.com...
As far as we can tell, no. *This is a remote service with dozens of users
invoking services continually. *There does not appear to be issues with
other
clients. *(We have three different development locations, each with the
same
issue, so it does not appear to be network or connection related.)
We have not yet found the exact cause, but we're looking into the
initialization process.
Jim
"densial" wrote:
>On Mar 27, 6:36 am, Jim Owen <j...@online.nospamwrote:
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 tobe
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 atleast
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 VS2008.
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.
This sounds like the serialization assemblies being created at runtime. Try
changing the settings of the Serialization Assembly dropdown at the bottom
of the Build pane of the properties window for the project.
--
---------------------------------------------------------------------------*-----
John Saunders | MVP Windows Server System Connected System Developer- Hide quoted text -

- Show quoted text -

I'm having the exact same issue with VS 2008 Team System with C# .net
3.5 XML web services.
Changing the Serialization Assembly worked to speed up the development
box, but did not help the IIS on 2k3 box.
Does anyone have something else to try? Along with this, it seems
that giving the app a 3-5 minute break between calls will cause the
same thing. The next call will take 15+ seconds to complete when it
had been doing them in a half second or less. Is there something to
set that can help keep the objects "alive"?

Thanks,
Jun 27 '08 #2
Hi Mike,
We eventually solved the issue although I'm not totally sure exactly what
we changed to make it work correctly.

In this particular solution, we have about 8 projects, most of which
access the web service and do so through a set of wrapper classes in one of
the projects.

We went though ALL of the projects and ensured that the Generate
Serialization Assembly was set to On for all projects. We then rebuilt the
entire solution and set the XMLSerialization dll's to read-only access.

After doing various repititions of the above, it began working as
expected. I suspect that the read-only file attribute was not necessary, but
we did get it working.

The issue is that the framework will generate the XML serialization
assembly for the call to the web service unless it is told to generate them
in advance. That compilation eats up the time.

Hope this helps,

- Jim
"ke**********@gmail.com" wrote:
On May 4, 4:14 pm, Jim Owen <j...@online.nospamwrote:
Hi John,

Hopefully this post will find its way back to you - or perhaps be answered
by someone else. As I mentioned in my last post on the earlier portion of
this thread, changing the serialization settings for the build handled the
initial slows we encountered when invoking the web service.

Since that time, we ported the original VB.net code over to C# - this was
done to make it cleaner easier to include the project in the rest of the C#
solution.

The problem is that the initial slows have re-appeared despite ensuring
the serialization option in the project were set to "On" and trying every
combination that we could think of.

We're using VS2008 Team Suite with the 3.5 framework. The web
references are still defined as web references rather that service references.

Any ideas what this might be at this time?

Regards,

Jim

"John Saunders [MVP]" wrote:
"Jim Owen" <j...@online.nospamwrote in message
>news:25**********************************@microso ft.com...
As far as we can tell, no. This is a remote service with dozens of users
invoking services continually. There does not appear to be issues with
other
clients. (We have three different development locations, each with the
same
issue, so it does not appear to be network or connection related.)
We have not yet found the exact cause, but we're looking into the
initialization process.
Jim
"densial" wrote:
On Mar 27, 6:36 am, Jim Owen <j...@online.nospamwrote:
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.
This sounds like the serialization assemblies being created at runtime. Try
changing the settings of the Serialization Assembly dropdown at the bottom
of the Build pane of the properties window for the project.
--
---------------------------------------------------------------------------*-----
John Saunders | MVP – Windows Server System – Connected System Developer- Hide quoted text -
- Show quoted text -


I'm having the exact same issue with VS 2008 Team System with C# .net
3.5 XML web services.
Changing the Serialization Assembly worked to speed up the development
box, but did not help the IIS on 2k3 box.
Does anyone have something else to try? Along with this, it seems
that giving the app a 3-5 minute break between calls will cause the
same thing. The next call will take 15+ seconds to complete when it
had been doing them in a half second or less. Is there something to
set that can help keep the objects "alive"?

Thanks,
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Drew Stoddard | last post by:
We are working in C#/Winforms and are using asynchronous client-side web service calls (the Begin... and End... methods supplied by the web reference creation). Many of these calls are contained...
2
by: Kevin Yu | last post by:
hi all got a questoin here, I have a winform client to call web service and the web service functions have EnableSession =ture, use IE to test the web service session, it works, but how to get...
2
by: Jack | last post by:
I want to design a server which performs some business related user authentiation, and would like to let the clients invoke it through webservice, so my first thinking is using IIS as the web...
5
by: benjamin_kohler | last post by:
hi, if have the following scenario: I have a winform client which communicates with a web service method that supports session (EnableSession=true), so a cookie is created for this client after...
4
by: magne.bergfjord | last post by:
I am new to web services, and wonder if it is possible to have a web service run all time and start the constructor before anyone calls any web method. My problem is that a lot of data is read in...
0
by: Jonathan King | last post by:
I have a web service, that until recently ran very quickly every time it was called, first call included. Now, the first time it is called, it is very slow and subsequent calls are normal. The...
3
by: Torben Laursen | last post by:
I have a COM shared add-in written in C# that I use in Excel. One of the thinks that the user can do is to open some winforms. The problem that I have is that the first time the user opens a...
1
by: ssaini | last post by:
Hi, I am consuming a java web service in .NET C# smart client, which is based upon Microsoft's SCSF application block.The SCSF is a wrapper over WinForms. When I make a call to any of the Java...
0
by: gefferson balase | last post by:
hello i have also this problem, its worst than you think it keeps me 27s waiting. I have a pda application calling the webservice on II6.0 using also VS 2005 on vb, I have already two servers...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.