From 86977acb58acebd7dce5bbfb748a4d13aeeff81f Mon Sep 17 00:00:00 2001 From: Atsushi Eno Date: Wed, 16 Feb 2011 17:07:10 +0900 Subject: [PATCH] Operation interface methods also have ServiceKnownType attributes. --- .../ContractDescriptionGenerator.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mcs/class/System.ServiceModel/System.ServiceModel.Description/ContractDescriptionGenerator.cs b/mcs/class/System.ServiceModel/System.ServiceModel.Description/ContractDescriptionGenerator.cs index 529a395a678..8801eb8637b 100644 --- a/mcs/class/System.ServiceModel/System.ServiceModel.Description/ContractDescriptionGenerator.cs +++ b/mcs/class/System.ServiceModel/System.ServiceModel.Description/ContractDescriptionGenerator.cs @@ -283,10 +283,11 @@ namespace System.ServiceModel.Description od.Messages.Add (GetMessage (od, mi, oca, true, isCallback, null)); if (!od.IsOneWay) od.Messages.Add (GetMessage (od, mi, oca, false, isCallback, asyncReturnType)); - foreach (ServiceKnownTypeAttribute a in cd.ContractType.GetCustomAttributes (typeof (ServiceKnownTypeAttribute), false)) - foreach (Type t in a.GetTypes ()) - od.KnownTypes.Add (t); - foreach (ServiceKnownTypeAttribute a in serviceMethod.GetCustomAttributes (typeof (ServiceKnownTypeAttribute), false)) + var knownTypeAtts = + cd.ContractType.GetCustomAttributes (typeof (ServiceKnownTypeAttribute), false).Union ( + mi.GetCustomAttributes (typeof (ServiceKnownTypeAttribute), false)).Union ( + serviceMethod.GetCustomAttributes (typeof (ServiceKnownTypeAttribute), false)); + foreach (ServiceKnownTypeAttribute a in knownTypeAtts) foreach (Type t in a.GetTypes ()) od.KnownTypes.Add (t); foreach (FaultContractAttribute a in mi.GetCustomAttributes (typeof (FaultContractAttribute), false)) { -- 2.11.4.GIT