Hi...
There are a few questions wrapped up in this, but the main one is that the
WebService.MyMe thodAsync() 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 M1CompletedEven tHandler(AsyncM 1Completed);
WS.M2Completed += new M2CompletedEven tHandler(AsyncM 2Completed);
WS.M1Async();
WS.M2Async();
....
private void AsyncM1Complete d(object sender, M1CompletedEven tArgs e)
{
this.M1DataSet = e.Result;
Debug.WriteLine ("Finished M1");
}
private void AsyncM2Complete d(object sender, M2CompletedEven tArgs 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, AsyncM1Complete d() 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 ServicePointMan ager has
default settings that wouldn't allow multiple calls to actually proceed
together. The article recommended
ServicePointMan ager.UseNagleAl gorithm = false;
ServicePointMan ager.Expect100C ontinue = false;
ServicePointMan ager.DefaultCon nectionLimit = 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.Enab leDecompression in VS is wrong - the default is false, not
true. I set that, and compression started working.
Any pointers would be appreciated.
Thanks
Mark
There are a few questions wrapped up in this, but the main one is that the
WebService.MyMe thodAsync() 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 M1CompletedEven tHandler(AsyncM 1Completed);
WS.M2Completed += new M2CompletedEven tHandler(AsyncM 2Completed);
WS.M1Async();
WS.M2Async();
....
private void AsyncM1Complete d(object sender, M1CompletedEven tArgs e)
{
this.M1DataSet = e.Result;
Debug.WriteLine ("Finished M1");
}
private void AsyncM2Complete d(object sender, M2CompletedEven tArgs 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, AsyncM1Complete d() 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 ServicePointMan ager has
default settings that wouldn't allow multiple calls to actually proceed
together. The article recommended
ServicePointMan ager.UseNagleAl gorithm = false;
ServicePointMan ager.Expect100C ontinue = false;
ServicePointMan ager.DefaultCon nectionLimit = 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.Enab leDecompression in VS is wrong - the default is false, not
true. I set that, and compression started working.
Any pointers would be appreciated.
Thanks
Mark
Comment