views:

24

answers:

1

How do I call a webservice in the Application_Exit event?

 private void Application_Exit(object sender, EventArgs e)
    {
        TestWSSoapClient.ReleaseUserCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(TestWSSoapClient_ReleaseUserCompleted);
        TestWSSoapClient.ReleaseUserAsync(UserToken);}

The method below is no longer executed.

void TestWSSoapClient_ReleaseUserCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
    {

    }

Thank you in advance.

A: 

I finally solved my problem by following this example

xscape