2010-01-13 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Wed, 13 Jan 2010 10:37:41 +0000 (10:37 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Wed, 13 Jan 2010 10:37:41 +0000 (10:37 -0000)
* ContractDescriptionGenerator.cs : fill Operation.Faults.

* FaultContractInfo.cs : implement.
* DispatchOperation.cs, ClientOperation.cs: fill Faults.

* net_2_1_raw_System.ServiceModel.dll.sources :
  add FaultContractInfo.cs.

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

mcs/class/System.ServiceModel/ChangeLog
mcs/class/System.ServiceModel/System.ServiceModel.Description/ChangeLog
mcs/class/System.ServiceModel/System.ServiceModel.Description/ContractDescriptionGenerator.cs
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChangeLog
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ClientOperation.cs
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/DispatchOperation.cs
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/FaultContractInfo.cs
mcs/class/System.ServiceModel/net_2_1_raw_System.ServiceModel.dll.sources

index d930e2138e7f9d169ca3bb014a8f25381b30f356..b89dc5c2aa66e5296878dfa7cead0cce0568540c 100755 (executable)
@@ -1,3 +1,8 @@
+2010-01-13  Astushi Enomoto  <atsushi@ximian.com>
+
+       * net_2_1_raw_System.ServiceModel.dll.sources :
+         add FaultContractInfo.cs.
+
 2010-01-13  Astushi Enomoto  <atsushi@ximian.com>
 
        * net_2_1_raw_System.ServiceModel.dll.sources :
index 961add56a6ba8c7d1048fa98c5251ba6e41ce352..7724067c55d54d4bf705c2488e526bdcee5a9eef 100644 (file)
@@ -1,3 +1,7 @@
+2010-01-13  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * ContractDescriptionGenerator.cs : fill Operation.Faults.
+
 2010-01-08  Atsushi Enomoto  <atsushi@ximian.com>
 
        * ContractDescriptionGenerator.cs : fix GetCallbackContract() to
index b4e52621998360d9631d52efd7c1124783628806..1a72a535648819f71c236b8d1d625f32dba02259 100644 (file)
@@ -245,6 +245,8 @@ namespace System.ServiceModel.Description
                                foreach (ServiceKnownTypeAttribute a in serviceMethod.GetCustomAttributes (typeof (ServiceKnownTypeAttribute), false))
                                        foreach (Type t in a.GetTypes ())
                                                od.KnownTypes.Add (t);
+                               foreach (FaultContractAttribute a in serviceMethod.GetCustomAttributes (typeof (FaultContractAttribute), false))
+                                       od.Faults.Add (new FaultDescription (a.Action) { DetailType = a.DetailType, Name = a.Name, Namespace = a.Namespace });
                                cd.Operations.Add (od);
                        }
                        else if (oca.AsyncPattern && od.BeginMethod != null ||
index 08f78317b777a85e4fb303d87511b301a8cb443a..23aa40917117a4cd506ee396d45de02e2cc065f9 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-13  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * FaultContractInfo.cs : implement.
+       * DispatchOperation.cs, ClientOperation.cs: fill Faults.
+
 2010-01-08  Atsushi Enomoto  <atsushi@ximian.com>
 
        * EndpointDispatcher.cs, InputOrReplyRequestProcessor.cs :
index 42ce0bcc6d1e1506ec807ba06e1f913e78a2a267..d7b99c9513deb7ea6bf24cedf1174bb2979847fe 100644 (file)
@@ -60,6 +60,9 @@ namespace System.ServiceModel.Dispatcher
                IClientMessageFormatter formatter, actual_formatter;
                SynchronizedCollection<IParameterInspector> inspectors
                        = new SynchronizedCollection<IParameterInspector> ();
+#if !NET_2_1
+               SynchronizedCollection<FaultContractInfo> fault_contract_infos;
+#endif
 
                public ClientOperation (ClientRuntime parent,
                        string name, string action)
@@ -103,7 +106,15 @@ namespace System.ServiceModel.Dispatcher
 
 #if !NET_2_1
                public SynchronizedCollection<FaultContractInfo> FaultContractInfos {
-                       get { throw new NotImplementedException (); }
+                       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;
+                       }
                }
 #endif
 
index 7597b90ba86e843e6c46d9664c419c534cdb2842..c550e9cf3e8b704d66d9f6728959dfb9df23318c 100644 (file)
@@ -59,8 +59,7 @@ namespace System.ServiceModel.Dispatcher
                IOperationInvoker invoker;
                SynchronizedCollection<IParameterInspector> inspectors
                        = new SynchronizedCollection<IParameterInspector> ();
-               SynchronizedCollection<FaultContractInfo> fault_contract_infos
-                       = new SynchronizedCollection<FaultContractInfo> ();
+               SynchronizedCollection<FaultContractInfo> fault_contract_infos;
                SynchronizedCollection<ICallContextInitializer> ctx_initializers
                        = new SynchronizedCollection<ICallContextInitializer> ();
 
@@ -107,7 +106,15 @@ namespace System.ServiceModel.Dispatcher
                }
 
                public SynchronizedCollection<FaultContractInfo> FaultContractInfos {
-                       get { return fault_contract_infos; }
+                       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;
+                       }
                }
 
                public IDispatchMessageFormatter Formatter {
index 4c58b78227a1f94c7e962885775d128465bf2620..98f44a5aef174d59f1ee3937ab2fde0842fd9967 100644 (file)
@@ -31,19 +31,18 @@ namespace System.ServiceModel.Dispatcher
 {
        public class FaultContractInfo
        {
-               string action;
-               Type detail;
-
                public FaultContractInfo (string action, Type detail)
                {
+                       if (action == null)
+                               throw new ArgumentNullException ("action");
+                       if (detail == null)
+                               throw new ArgumentNullException ("detail");
+                       Action = action;
+                       Detail = detail;
                }
 
-               public string Action {
-                       get { return action; }
-               }
+               public string Action { get; private set; }
 
-               public Type Detail {
-                       get { return detail; }
-               }
+               public Type Detail { get; private set; }
        }
 }
index 55a494dadf1fb56ab036de68ff861b813cdac028..3297472efadac7b469e0868dbf2c73a801575028 100755 (executable)
@@ -149,6 +149,7 @@ System.ServiceModel.Description/ServiceEndpoint.cs
 System.ServiceModel.Dispatcher/BaseMessagesFormatter.cs
 System.ServiceModel.Dispatcher/ClientOperation.cs
 System.ServiceModel.Dispatcher/ClientRuntime.cs
+System.ServiceModel.Dispatcher/FaultContractInfo.cs
 System.ServiceModel.Dispatcher/IChannelInitializer.cs
 System.ServiceModel.Dispatcher/IClientMessageFormatter.cs
 System.ServiceModel.Dispatcher/IClientMessageInspector.cs