473,387 Members | 3,787 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,387 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 1951
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.