Flush some ongoing changes for XmlSerializer support in svcutil.
authorAtsushi Eno <atsushi@ximian.com>
Tue, 14 Jun 2011 08:58:26 +0000 (17:58 +0900)
committerAtsushi Eno <atsushi@ximian.com>
Tue, 14 Jun 2011 08:58:26 +0000 (17:58 +0900)
mcs/class/System.ServiceModel/System.ServiceModel.Description/DataContractSerializerMessageContractImporter.cs
mcs/class/System.ServiceModel/System.ServiceModel.Description/ServiceContractGenerator.cs

index eb72662f5653294cc3d58c40d9728eee9aed22fc..bc5610647f7a593215723b1e14f687e9c5bad4df 100644 (file)
@@ -189,7 +189,7 @@ namespace System.ServiceModel.Description
                        foreach (OperationMessage opmsg in op.Messages) {
                                var parts = context.GetMessageDescription (opmsg).Body.Parts;
                                foreach (var part in parts)
-                                       if (part.DataContractImporter != null)
+                                       if (part.DataContractImporter != null || part.XmlSerializationImporter != null)
                                                return true;
                        }
                        return false;
index f6b47c52caf6286605f9c50ca3b5916a7a5a9264..e26e6cb06b6d3a359c1d8cde86cc5429c9ca2980 100644 (file)
@@ -365,6 +365,9 @@ namespace System.ServiceModel.Description
                {
                        CodeMemberMethod cm = new CodeMemberMethod ();
 
+                       if (od.Behaviors.Find<XmlSerializerMappingBehavior> () != null)
+                               cm.CustomAttributes.Add (new CodeAttributeDeclaration (new CodeTypeReference (typeof (XmlSerializerFormatAttribute))));
+
                        if (async)
                                cm.Name = "Begin" + od.Name;
                        else