NTD App using WebServices very slow to start

D

Daren May

I have a WinForm app that is deployed via NTD from a webserver (Windows XP
SP2 running IIS V5.1). The App accesses a number of WebServices that are
hosted on the same webserver. The webservices interact with an Oracle DB
hosted on another machine. The WinForm app has a strongname and the client
computers have had their CASPOL amended to execute all assemblies matching
the public key with Full Trust. The application launches... eventually (it
takes a few minutes to launch). If I NTD an application that does not use
Web Services, it starts quickly.

Any pointers would be welcome.
 
J

Joshua Flanagan

Are you calling the web services synchronously in the Form.Load event?
That would definitely cause a perceived delay in launching the
application. Web services are always slow the first time they are
called from an app. If you call in synchronously from your Form.Load,
you won't see the form until the web service call completes.

As a general rule, you usually want to call web services asynchronously
from a WinForms app. Just use the BeginMethodName() version of the
method. Make sure to setup a callback method so you can call
EndMethodName().

It also might help to let the form load, and then make the web service
call. That might help with "perceived" load time.
 
J

John Vottero

Daren May said:
I have a WinForm app that is deployed via NTD from a webserver (Windows XP
SP2 running IIS V5.1). The App accesses a number of WebServices that are
hosted on the same webserver. The webservices interact with an Oracle DB
hosted on another machine. The WinForm app has a strongname and the client
computers have had their CASPOL amended to execute all assemblies matching
the public key with Full Trust. The application launches... eventually (it
takes a few minutes to launch). If I NTD an application that does not use
Web Services, it starts quickly.

Any pointers would be welcome.

You might be able to fix this problem by doing:

ConfigurationSettings.GetConfig("foo");
Note that there isn't a "foo" config setting but the call forces
ConfigurationSettings to be initialized. Someone else will have to explain
what the problem is and why this fixes it, I don't know. I found this in
the newsgroups when I was trying to figure out why our app was so slow with
NTD but fast without.
 
J

Jeffrey Tan[MSFT]

Hi Daren,

Based on my understanding, you meet the slow start problem in NTD
application invoking WebService.

How long the delay will go on? Normally, there is a known issue about
hosting Winform control in IE that invoking remoting connection will delay
90 or 100 seconds. This is due to the threads deadlock.

You may try John's suggestion to invoke
ConfigurationSettings.GetConfig("foo") to see if it resolves your problem.

=================================
Please apply my suggestion above and let me know if it helps resolve your
problem.

Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
D

Daren May

Hi Gents,

Thank you for your responses - it turns out it was a security issue! I
looked at the IIS log and noticed a large number of refused connections,
despite configuring group level access, etc. It appeared to me that NTD
appears to try with the least privilege first, then escalates as the
connections fail, and this created the delay. When I reconfigured the
security to allow anonymous access, my delays disappeared.

Once again, thank you for your responses.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top