Handle fault messages in duplex callback channel.
authorAtsushi Eno <atsushi@ximian.com>
Wed, 27 Apr 2011 11:56:05 +0000 (20:56 +0900)
committerAtsushi Eno <atsushi@ximian.com>
Wed, 27 Apr 2011 11:56:05 +0000 (20:56 +0900)
mcs/class/System.ServiceModel/System.ServiceModel/DuplexClientRuntimeChannel.cs

index 996295d609c8e50823f38a2a38bdd6d959be2b32..4fa56e12a78a964bba565818d308429d40ba09e6 100644 (file)
@@ -171,6 +171,15 @@ namespace System.ServiceModel.MonoInternal
                                        }
                                }
                                
+                               if (message.IsFault) {
+                                       Exception ex;
+                                       var mf = MessageFault.CreateFault (message, 0x10000);
+                                       if (FaultConverter.GetDefaultFaultConverter (message.Version).TryCreateException (message, mf, out ex)) // FIXME: get maxMessageSize somehow
+                                               throw ex;
+                                       else
+                                               throw new FaultException (mf);
+                               }
+                               
                                if (!MessageMatchesEndpointDispatcher (message, Runtime.CallbackDispatchRuntime.EndpointDispatcher))
                                        throw new EndpointNotFoundException (String.Format ("The request message has the target '{0}' with action '{1}' which is not reachable in this service contract", message.Headers.To, message.Headers.Action));
                                new InputOrReplyRequestProcessor (Runtime.CallbackDispatchRuntime, input).ProcessInput (message);