From 642bfdb13c391eb8fa461d4e980a0da423ca0181 Mon Sep 17 00:00:00 2001 From: Atsushi Eno Date: Fri, 2 Apr 2010 05:43:44 +0000 Subject: [PATCH] 2010-04-02 Atsushi Enomoto * EndpointDispatcher.cs : fill FaultContractInfos. * DispatchOperation.cs : do not fill them dynamically/automatically. * ErrorProcessingHandler.cs : added some FIXME notes. svn path=/trunk/mcs/; revision=154690 --- .../System.ServiceModel.Dispatcher/ChangeLog | 6 ++++++ .../DispatchOperation.cs | 13 +++---------- .../EndpointDispatcher.cs | 3 +++ .../ErrorProcessingHandler.cs | 3 +++ 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChangeLog b/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChangeLog index fe25620dde9..19de44dec7b 100644 --- a/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChangeLog +++ b/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChangeLog @@ -1,3 +1,9 @@ +2010-04-02 Atsushi Enomoto + + * EndpointDispatcher.cs : fill FaultContractInfos. + * DispatchOperation.cs : do not fill them dynamically/automatically. + * ErrorProcessingHandler.cs : added some FIXME notes. + 2010-03-30 Atsushi Enomoto * ChannelDispatcher.cs : differentiate EndpointNotFound and diff --git a/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/DispatchOperation.cs b/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/DispatchOperation.cs index 832dc557009..cedc7e66693 100644 --- a/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/DispatchOperation.cs +++ b/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/DispatchOperation.cs @@ -59,7 +59,8 @@ namespace System.ServiceModel.Dispatcher IOperationInvoker invoker; SynchronizedCollection inspectors = new SynchronizedCollection (); - SynchronizedCollection fault_contract_infos; + SynchronizedCollection fault_contract_infos + = new SynchronizedCollection (); SynchronizedCollection ctx_initializers = new SynchronizedCollection (); @@ -106,15 +107,7 @@ namespace System.ServiceModel.Dispatcher } public SynchronizedCollection FaultContractInfos { - get { - if (fault_contract_infos == null) { - var l = new SynchronizedCollection (); - 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 { diff --git a/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/EndpointDispatcher.cs b/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/EndpointDispatcher.cs index c5c7deb28e9..f8568b7e078 100644 --- a/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/EndpointDispatcher.cs +++ b/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/EndpointDispatcher.cs @@ -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); diff --git a/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ErrorProcessingHandler.cs b/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ErrorProcessingHandler.cs index 5157e4c7421..f6606a21898 100644 --- a/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ErrorProcessingHandler.cs +++ b/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ErrorProcessingHandler.cs @@ -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 -- 2.25.1