[Mono-bugs] [Bug 549926] Problem with exception handling with async (Web) Service calls

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Nov 2 16:22:14 EST 2009


User gnorton at novell.com added comment

Geoff Norton <gnorton at novell.com> changed:

           What    |Removed                     |Added
                 CC|                            |gnorton at novell.com
         AssignedTo|mono-bugs at lists.ximian.com  |atsushi at ximian.com

--- Comment #2 from Geoff Norton <gnorton at novell.com>  2009-11-02 14:22:08 MST ---

  Looking thru the code here, the issue is this, calling into a WCF service
with a callback set, but the service returns lets say a 403 or a 404, we fall
into this block:

                void GotResponse (IAsyncResult result)
                        HttpChannelRequestAsyncResult channelResult =
(HttpChannelRequestAsyncResult) result.AsyncState;
                        channelResult.CompletedSynchronously &=

                        WebResponse res;
                        Stream resstr;
                        try {
                                res = web_request.EndGetResponse (result);
                                resstr = res.GetResponseStream ();
                        } catch (WebException we) {
                                res = we.Response;
#if NET_2_1 // debug
                                Console.WriteLine (we);
                                try {
                                        // The response might contain SOAP
fault. It might not.
                                        resstr = res.GetResponseStream ();
                                } catch (WebException we2) {
#if NET_2_1 // debug
                                        Console.WriteLine (we2);

Console.WriteLine ("completing with we2");
                                        channelResult.Complete (we2);

When we call channelResult.Complete (we2), callback isn't set, so it never
bubbles up to user code.

-> eno

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list