async client calls not completing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?TWFyaw==?=

    async client calls not completing

    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

  • Steven Cheng [MSFT]

    #2
    RE: async client calls not completing

    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 ServicePointMan ager.DefaultCon nectionLimit, it does have a default
    2 limit, that's for connection to a given remote server. You can enlarge it
    either via the ServicePointMan ager.DefaultCon nectionLimit 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:
    msdnmg@microsof t.com.

    =============== =============== =============== =====
    Get notification to my posts through email? Please refer to
    Gain technical skills through documentation and training, earn certifications and connect with the community

    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==?= <mmodrall@nospa m.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.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

    Working...