472,952 Members | 2,216 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

async client calls not completing

Hi...

There are a few questions wrapped up in this, but the main one is that the
WebService.MyMethodAsync() methods that are automatically generated in the
client code by VS 2005 don't seem to be finishing for me.

We have a VS add-in written in .net that used to make a number of database
calls to fill forms. To improve security, we moved the db calls to a web
service and return DataSets for the calls (the result sets are always
reasonably small).

I thought I'd go the extra step and use async calls and compression. I
changed a couple of the calls to

WS.M1Completed += new M1CompletedEventHandler(AsyncM1Completed);
WS.M2Completed += new M2CompletedEventHandler(AsyncM2Completed);
WS.M1Async();
WS.M2Async();
....
private void AsyncM1Completed(object sender, M1CompletedEventArgs e)
{
this.M1DataSet = e.Result;
Debug.WriteLine("Finished M1");
}

private void AsyncM2Completed(object sender, M2CompletedEventArgs e)
{
this.M2DataSet = e.Result;
Debug.WriteLine("Finished M2");
}

The main problem is that even though I see the request completed on the web
service side, AsyncM1Completed() is never called. From all the examples I
found, it looks like this should work. Am I missing something obvious?

The second problem is that M2Async() never seems to get called. I googled
around and found some articles saying that by default ServicePointManager has
default settings that wouldn't allow multiple calls to actually proceed
together. The article recommended

ServicePointManager.UseNagleAlgorithm = false;
ServicePointManager.Expect100Continue = false;
ServicePointManager.DefaultConnectionLimit = 10;

for best performance. I put that in, but am not seeing the 2 async calls
getting fired - still the first one never completing.

I googled around and found the trick that the metadata for the
WebService.EnableDecompression in VS is wrong - the default is false, not
true. I set that, and compression started working.

Any pointers would be appreciated.

Thanks
Mark

Jun 27 '08 #1
1 1908
Hi Mark,

From your description, you're using the async operation of the webservice
proxy methods, however, found that the callback of the async operation
never get executed, correct?

From the code snippet you provided, what you used is the new async model
provided in .net framework 2.0 and the code is quite straightforward. So I
think the code logic is correct, just attach event and then call the
XXXAsync method.

I think currently we may try to isolate the issue first. For example, make
the webservice a very simple helloworld one(with some time delay). And move
the webservice call to console application to watch the behavior.

For the ServicePointManager.DefaultConnectionLimit, it does have a default
2 limit, that's for connection to a given remote server. You can enlarge it
either via the ServicePointManager.DefaultConnectionLimit or via
"system.net" section in app.config file.

Anyway, please feel free to let me know if there is any new finding on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: =?Utf-8?B?TWFyaw==?= <mm******@nospam.nospam>
Subject: async client calls not completing
Date: Tue, 10 Jun 2008 11:04:02 -0700
Hi...

There are a few questions wrapped up in this, but the main one is that the
WebService.MyMethodAsync() methods that are automatically generated in the
client code by VS 2005 don't seem to be finishing for me.

We have a VS add-in written in .net that used to make a number of database
calls to fill forms. To improve security, we moved the db calls to a web
service and return DataSets for the calls (the result sets are always
reasonably small).

I thought I'd go the extra step and use async calls and compression. I
changed a couple of the calls to

WS.M1Completed += new M1CompletedEventHandler(AsyncM1Completed);
WS.M2Completed += new M2CompletedEventHandler(AsyncM2Completed);
WS.M1Async();
WS.M2Async();
...
private void AsyncM1Completed(object sender, M1CompletedEventArgs e)
{
this.M1DataSet = e.Result;
Debug.WriteLine("Finished M1");
}

private void AsyncM2Completed(object sender, M2CompletedEventArgs e)
{
this.M2DataSet = e.Result;
Debug.WriteLine("Finished M2");
}

The main problem is that even though I see the request completed on the web
service side, AsyncM1Completed() is never called. From all the examples I
found, it looks like this should work. Am I missing something obvious?

The second problem is that M2Async() never seems to get called. I googled
around and found some articles saying that by default ServicePointManager
has
default settings that wouldn't allow multiple calls to actually proceed
together. The article recommended

ServicePointManager.UseNagleAlgorithm = false;
ServicePointManager.Expect100Continue = false;
ServicePointManager.DefaultConnectionLimit = 10;

for best performance. I put that in, but am not seeing the 2 async calls
getting fired - still the first one never completing.

I googled around and found the trick that the metadata for the
WebService.EnableDecompression in VS is wrong - the default is false, not
true. I set that, and compression started working.

Any pointers would be appreciated.

Thanks
Mark
Jun 27 '08 #2

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

Similar topics

3
by: mvdevnull | last post by:
static void Main(string args) { DoSomething(); } static void DoSomething() { for (int i=0; i<=10; i++) { CallAsyncMethod(); } } my problem is when i run the app console exists without really...
6
by: Vanessa | last post by:
I have a question regarding async mode for calling Microsoft.XMLHTTP object. Microsoft.XMLHTTP hangs the IE once in a while suddenly, but it will work again after half an hour or so without doing...
1
by: Simon Hart | last post by:
Hi, I thought I'd just open a thread in an attempt to get peoples feelers with regards to multithreading vs Async Web Service processing. Of course Web Services makes it easy to do Async...
0
by: whizpop | last post by:
Hi, First of all, thanks for a great starter kit, now If I could just get it to work (fully). I am trying to compile and run the solution/services all on a local dev box. I am able to...
6
by: Shak | last post by:
Hi all, Three questions really: 1) The async call to the networkstream's endread() (or even endxxx() in general) blocks. Async calls are made on the threadpool - aren't we advised not to...
7
by: Shak | last post by:
Hi all, I'm trying to write a thread-safe async method to send a message of the form (type)(contents). My model is as follows: private void SendMessage(int type, string message) { //lets...
7
by: =?Utf-8?B?Q2FybG8gRm9saW5p?= | last post by:
Hi, I implemented asynchronous calls to a web resource (using HttpWebRequest) from asp.net 2.0. The request it's made asyncronously (I see that beginGetResponse returns immediately). The number...
12
by: =?Utf-8?B?cGI=?= | last post by:
I am having trouble doing a redirect in an async asp.net implemention. Most of the time it works, but when it doesn't it just "hangs", the browser never gets any return page. If I run it under the...
1
by: Ryan Liu | last post by:
Hi, I have a 100 clients/ one server application, use ugly one thread pre client approach. And both side user sync I/O. I frequently see the error on server side(client side code is same, but...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

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.