|
| Creation of "large" web service proxy object takes 10 seconds |
|
|
|
|
| Messages |
|
Related Types |
This message was discovered on microsoft.public.dotnet.framework.performance.
| Dave Morgereth |
We have a web service that exposes approximately 40 methods and 40 typed datasets. We used Visual Studio to create a Windows form client and added web reference. Everything "works", but I've noticed that the initial creation of the web service "proxy" object takes over 10 seconds. I assume this is because the class created by Visual Studio when the web reference is added is rather large.
public void CallMyService ( ) { Service1.myService myService = new Service1.myService( ); <-- This takes 10 seconds MessageBox.Show (myService.HelloWorld()); <-- This takes 1 second }
The first time CallMyService is invoked, the "new Service1.myService()" takes over 10 seconds. On subsequent calls to CallMyService, it takes less than 1 second. Actually invoking a web method ALWAYS takes 1 second.
I've tried ngen with little improvement. I've also tried using threading/delegates to overlap the proxy creation with other "housekeeping" that we have to do, also with little improvement. Is there any way to improve this?
TIA Dave
|
|
|
| |
|
| |
| |
| Dev Eloper |
I suggest you run a profiler and see what takes time when creating an instance of the proxy (or make the proxy available so anyone here can try).
If you need to do this often in your program, keep a pool of proxies so you don't need to re-create them.
"Dave Morgereth" <Click here to reveal e-mail address> wrote in message news:OLm68UcMCHA.2256@tkmsftngp13... [Original message clipped]
|
|
|
| |
|
| |
| |
| 3ddA |
Hello!
We have the same problem, but with a webservice of 50 methods and around 60 classes the creation of the web service proxy object can take up to 20 seconds on my 350MHz machine.
Profiling: The main problem seems to be in the System.Web.Services.Protocols.SoapHttpClientProtocol constructor which takes about 99% of the time. In this method a child method named System.Xml.Serialization.XmlSerializer.FromMappings takes 95% of the time.
Is there anyway that I can make this process execute faster?
/Regards 3ddA
|
|
|
| |
|
|
| |
|
| |
| Dave Morgereth |
I used Compuware's profiler and learned (not surprisingly) that the bulk of the time is spent in the constructor for the proxy. It looks like most of the time is spent in the ..ctor and .InitClass methods of the DataTables exposed by our typed DataSets. We do not explicitly call the .ctor and ..InitClass methods, so they must be being called as part of the constructor for the proxy.
The proxy is implemented as a singleton (ie we keep the proxy around so that it doesn't have to be re-created). My goal is to reduce the amount of time it takes for our app to start.
"Dev Eloper" <Click here to reveal e-mail address> wrote in message news:#caw0SoMCHA.2420@tkmsftngp11... [Original message clipped]
|
|
|
| |
|
| |
|
|
|
|
|
|
|
|
|
BootFX
Reliable and powerful .NET application framework. |
|
|
|
|
|
|