Esempio n. 1
0
            public static void RemoveUnneededSerializers(CommandProcessorOptions options, ServiceDescriptor serviceDescriptor, Collection <IWsdlImportExtension> wsdlImportExtensions)
            {
                if ((options.SerializerMode == SerializerMode.Auto || options.SerializerMode == SerializerMode.Default) && serviceDescriptor.ContainsHttpBindings())
                {
                    // NOTE: HTTP Get/Post binding indicates an old web service. We use XmlSerializer to prevent generating dup classes.
                    // Please check devdiv bug 94078
                    options.SerializerMode = SerializerMode.XmlSerializer;
                }

                switch (options.SerializerMode)
                {
                case SerializerMode.Default:
                case SerializerMode.Auto:
                    break;

                case SerializerMode.XmlSerializer:
                    RemoveExtension(typeof(DataContractSerializerMessageContractImporter), wsdlImportExtensions);
                    break;

                case SerializerMode.DataContractSerializer:
                    RemoveExtension(typeof(XmlSerializerMessageContractImporter), wsdlImportExtensions);
                    break;

                default:
                    Debug.Assert(false, "Unrecognized serializer option!");
                    break;
                }
            }