2010-04-02 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Fri, 2 Apr 2010 05:43:44 +0000 (05:43 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Fri, 2 Apr 2010 05:43:44 +0000 (05:43 -0000)
* EndpointDispatcher.cs : fill FaultContractInfos.
* DispatchOperation.cs : do not fill them dynamically/automatically.
* ErrorProcessingHandler.cs : added some FIXME notes.

svn path=/trunk/mcs/; revision=154690

mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChangeLog
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/DispatchOperation.cs
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/EndpointDispatcher.cs
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ErrorProcessingHandler.cs

index fe25620dde9e77c29ed7bf9dc7188c2792e9a48e..19de44dec7bfc8a47c77e337171dbf4cc37e652c 100644 (file)
@@ -1,3 +1,9 @@
+2010-04-02  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * EndpointDispatcher.cs : fill FaultContractInfos.
+       * DispatchOperation.cs : do not fill them dynamically/automatically.
+       * ErrorProcessingHandler.cs : added some FIXME notes.
+
 2010-03-30  Atsushi Enomoto  <atsushi@ximian.com>
 
        * ChannelDispatcher.cs : differentiate EndpointNotFound and
index 832dc5570099375805d162fa36be13f6b0118d20..cedc7e666938e277c4fcf35f6c23aa79e13f47e7 100644 (file)
@@ -59,7 +59,8 @@ namespace System.ServiceModel.Dispatcher
                IOperationInvoker invoker;
                SynchronizedCollection<IParameterInspector> inspectors
                        = new SynchronizedCollection<IParameterInspector> ();
-               SynchronizedCollection<FaultContractInfo> fault_contract_infos;
+               SynchronizedCollection<FaultContractInfo> fault_contract_infos
+                       = new SynchronizedCollection<FaultContractInfo> ();
                SynchronizedCollection<ICallContextInitializer> ctx_initializers
                        = new SynchronizedCollection<ICallContextInitializer> ();
 
@@ -106,15 +107,7 @@ namespace System.ServiceModel.Dispatcher
                }
 
                public SynchronizedCollection<FaultContractInfo> FaultContractInfos {
-                       get {
-                               if (fault_contract_infos == null) {
-                                       var l = new SynchronizedCollection<FaultContractInfo> ();
-                                       foreach (var f in Description.Faults)
-                                               l.Add (new FaultContractInfo (f.Action, f.DetailType));
-                                       fault_contract_infos = l;
-                               }
-                               return fault_contract_infos;
-                       }
+                       get { return fault_contract_infos; }
                }
 
                public IDispatchMessageFormatter Formatter {
index c5c7deb28e9ec7ddd8c6929cab05f0ee07a015af..f8568b7e0781aa9f0ae501f95c6f51326338ab59 100644 (file)
@@ -159,6 +159,9 @@ namespace System.ServiceModel.Dispatcher
                                }
                        }
 
+                       foreach (var fd in od.Faults)
+                               o.FaultContractInfos.Add (new FaultContractInfo (fd.Action, fd.DetailType));
+
                        // Setup Invoker
                        o.Invoker = new DefaultOperationInvoker (od);
 
index 5157e4c7421745da71992bf78b5c646559f3c4db..f6606a2189818abaaec7c499b80c5f5eeb490885 100644 (file)
@@ -26,11 +26,14 @@ namespace System.ServiceModel.Dispatcher
                                if (handler.HandleError (ex))
                                        break;
 
+                       // FIXME: remove them. FaultConverter also covers errors like EndpointNotFoundException, which this handler never covers. And checking converter twice is extraneous, so this part is just extraneous.
+                       // FIXME: instead, FaultContractInfos should be checked
                        FaultConverter fc = FaultConverter.GetDefaultFaultConverter (dispatchRuntime.ChannelDispatcher.MessageVersion);
                        Message res = null;                     
                        if (!fc.TryCreateFaultMessage (ex, out res))
                                throw ex;
                        mrc.ReplyMessage = res;
+
                        if (duplex != null)
                                mrc.Reply (duplex, true);
                        else