Browse Source

2010-04-02 Atsushi Enomoto <[email protected]>

	* EndpointDispatcher.cs : fill FaultContractInfos.
	* DispatchOperation.cs : do not fill them dynamically/automatically.
	* ErrorProcessingHandler.cs : added some FIXME notes.


svn path=/trunk/mcs/; revision=154690
Atsushi Eno 15 years ago
parent
commit
642bfdb13c

+ 6 - 0
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChangeLog

@@ -1,3 +1,9 @@
+2010-04-02  Atsushi Enomoto  <[email protected]>
+
+	* EndpointDispatcher.cs : fill FaultContractInfos.
+	* DispatchOperation.cs : do not fill them dynamically/automatically.
+	* ErrorProcessingHandler.cs : added some FIXME notes.
+
 2010-03-30  Atsushi Enomoto  <[email protected]>
 
 	* ChannelDispatcher.cs : differentiate EndpointNotFound and

+ 3 - 10
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/DispatchOperation.cs

@@ -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 {

+ 3 - 0
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);
 

+ 3 - 0
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