ServiceDescription.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Services / Web / System / Web / Services / Description / ServiceDescription.cs / 1305376 / ServiceDescription.cs

                            //------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------------------- 

namespace System.Web.Services.Description { 
 
    using System.Xml.Serialization;
    using System.Xml.Schema; 
    using System.Collections;
    using System.Collections.Specialized;
    using System;
    using System.Xml; 
    using System.IO;
    using System.Reflection; 
    using System.ComponentModel; 
    using System.CodeDom;
    using System.Text; 
    using System.Web.Services.Configuration;
    using System.Diagnostics;
    using System.Threading;
    using System.Globalization; 
    using System.Runtime.InteropServices;
    using System.Web.Services.Protocols; 
 
    /// 
    ///  
    ///
    /// 
    [XmlRoot("definitions", Namespace=ServiceDescription.Namespace)]
    [XmlFormatExtensionPoint("Extensions")] 
    public sealed class ServiceDescription : NamedItem {
        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public const string Namespace = "http://schemas.xmlsoap.org/wsdl/";
        internal const string Prefix = "wsdl";
        Types types;
        ImportCollection imports; 
        MessageCollection messages;
        PortTypeCollection portTypes; 
        BindingCollection bindings; 
        ServiceCollection services;
        string targetNamespace; 
        ServiceDescriptionFormatExtensionCollection extensions;
        ServiceDescriptionCollection parent;
        string appSettingUrlKey;
        string appSettingBaseUrl; 
        string retrievalUrl;
        static XmlSerializer serializer; 
        static XmlSerializerNamespaces namespaces; 
        const WsiProfiles SupportedClaims = WsiProfiles.BasicProfile1_1;
        static XmlSchema schema = null; 
        static XmlSchema soapEncodingSchema = null;
        StringCollection validationWarnings;
        static StringCollection warnings = new StringCollection();
        ServiceDescription next; 

        private static void InstanceValidation (object sender, ValidationEventArgs args) { 
            warnings.Add(Res.GetString(Res.WsdlInstanceValidationDetails, args.Message, args.Exception.LineNumber.ToString(CultureInfo.InvariantCulture), args.Exception.LinePosition.ToString(CultureInfo.InvariantCulture))); 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        [XmlIgnore]
        public string RetrievalUrl { 
            get { return retrievalUrl == null ? string.Empty : retrievalUrl; } 
            set { retrievalUrl = value; }
        } 

        internal void SetParent(ServiceDescriptionCollection parent) {
            this.parent = parent;
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        [XmlIgnore]
        public ServiceDescriptionCollection ServiceDescriptions {
            get { return parent; }
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions {
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; }
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        [XmlElement("import")]
        public ImportCollection Imports {
            get { if (imports == null) imports = new ImportCollection(this); return imports; }
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        [XmlElement("types")]
        public Types Types {
            get { if (types == null) types = new Types(); return types; }
            set { types = value; } 
        }
 
        private bool ShouldSerializeTypes() { return Types.HasItems(); } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        [XmlElement("message")] 
        public MessageCollection Messages {
            get { if (messages == null) messages = new MessageCollection(this); return messages; } 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        [XmlElement("portType")] 
        public PortTypeCollection PortTypes {
            get { if (portTypes == null) portTypes = new PortTypeCollection(this); return portTypes; } 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        [XmlElement("binding")] 
        public BindingCollection Bindings {
            get { if (bindings == null) bindings = new BindingCollection(this); return bindings; } 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        [XmlElement("service")] 
        public ServiceCollection Services {
            get { if (services == null) services = new ServiceCollection(this); return services; } 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        [XmlAttribute("targetNamespace")] 
        public string TargetNamespace {
            get { return targetNamespace; } 
            set { targetNamespace = value; } 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public static XmlSchema Schema {
            get { 
                if (schema == null) { 
                    schema = XmlSchema.Read(new StringReader(Schemas.Wsdl), null);
                } 
                return schema;
            }
        }
 
        internal static XmlSchema SoapEncodingSchema {
            get { 
                if (soapEncodingSchema == null) { 
                    soapEncodingSchema = XmlSchema.Read(new StringReader(Schemas.SoapEncoding), null);
                } 
                return soapEncodingSchema;
            }
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        [XmlIgnore] 
        public StringCollection ValidationWarnings {
            get {
                if (validationWarnings == null) {
                    validationWarnings = new StringCollection(); 
                }
                return validationWarnings; 
            } 
        }
 
        internal void SetWarnings(StringCollection warnings) {
            this.validationWarnings = warnings;
        }
 
        // This is a special serializer that hardwires to the generated
        // ServiceDescriptionSerializer. To regenerate the serializer 
        // Turn on KEEPTEMPFILES 
        // Restart server
        // Run wsdl as follows 
        //   wsdl ?wsdl
        // Goto windows temp dir (usually \winnt\temp)
        // and get the latest generated .cs file
        // Change namespace to 'System.Web.Services.Description' 
        // Change class names to ServiceDescriptionSerializationWriter
        // and ServiceDescriptionSerializationReader 
        // Make the classes internal 
        // Ensure the public Write method is Write125_definitions (If not
        // change Serialize to call the new one) 
        // Ensure the public Read method is Read126_definitions (If not
        // change Deserialize to call the new one)
        internal class ServiceDescriptionSerializer : XmlSerializer {
            protected override XmlSerializationReader CreateReader() { 
                return new ServiceDescriptionSerializationReader();
            } 
            protected override XmlSerializationWriter CreateWriter() { 
                return new ServiceDescriptionSerializationWriter();
            } 
            public override bool CanDeserialize(System.Xml.XmlReader xmlReader){
                return xmlReader.IsStartElement("definitions", ServiceDescription.Namespace);
            }
            protected override void Serialize(Object objectToSerialize, XmlSerializationWriter writer){ 
                ((ServiceDescriptionSerializationWriter)writer).Write125_definitions(objectToSerialize);
            } 
            protected override object Deserialize(XmlSerializationReader reader){ 
                return ((ServiceDescriptionSerializationReader)reader).Read125_definitions();
            } 
        }
        /// 
        /// 
        /// Returns the serializer for processing web service calls.  The serializer is customized according 
        /// to settings in config.web.
        ///  
        ///  
        /// 
        [XmlIgnore] 
        public static XmlSerializer Serializer {
            get {
                if (serializer == null) {
                    WebServicesSection config = WebServicesSection.Current; 
                    XmlAttributeOverrides overrides = new XmlAttributeOverrides();
                    XmlSerializerNamespaces ns = new XmlSerializerNamespaces(); 
                    ns.Add("s", XmlSchema.Namespace); 
                    WebServicesSection.LoadXmlFormatExtensions(config.GetAllFormatExtensionTypes(), overrides, ns);
                    namespaces = ns; 
                    if (config.ServiceDescriptionExtended)
                        serializer = new XmlSerializer(typeof(ServiceDescription), overrides);
                    else
                        serializer = new ServiceDescriptionSerializer(); 
                    serializer.UnknownElement += new XmlElementEventHandler(RuntimeUtils.OnUnknownElement);
                } 
                return serializer; 
            }
        } 

        internal string AppSettingBaseUrl {
            get { return appSettingBaseUrl; }
            set { appSettingBaseUrl = value; } 
        }
 
        internal string AppSettingUrlKey { 
            get { return appSettingUrlKey; }
            set { appSettingUrlKey = value; } 
        }

        internal ServiceDescription Next {
            get { return next; } 
            set { next = value; }
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public static ServiceDescription Read(TextReader textReader) {
            return Read(textReader, false); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public static ServiceDescription Read(Stream stream) {
            return Read(stream, false);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public static ServiceDescription Read(XmlReader reader) {
            return Read(reader, false);
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public static ServiceDescription Read(string fileName) { 
            return Read(fileName, false);
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public static ServiceDescription Read(TextReader textReader, bool validate) {
            XmlTextReader reader = new XmlTextReader(textReader);	 
            reader.WhitespaceHandling = WhitespaceHandling.Significant;
            reader.XmlResolver = null;
            reader.DtdProcessing = DtdProcessing.Prohibit;
            return Read(reader, validate); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public static ServiceDescription Read(Stream stream, bool validate) {
            XmlTextReader reader = new XmlTextReader(stream);
            reader.WhitespaceHandling = WhitespaceHandling.Significant; 
            reader.XmlResolver = null;
            reader.DtdProcessing = DtdProcessing.Prohibit; 
            return Read(reader, validate); 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public static ServiceDescription Read(string fileName, bool validate) {
            StreamReader reader = new StreamReader(fileName, Encoding.Default, true); 
            try { 
                return Read(reader, validate);
            } 
            finally {
                reader.Close();
            }
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public static ServiceDescription Read(XmlReader reader, bool validate) {
            if (validate) {
                XmlReaderSettings readerSettings = new XmlReaderSettings();
 
 				readerSettings.ValidationType = ValidationType.Schema;
				readerSettings.ValidationFlags = XmlSchemaValidationFlags.ProcessIdentityConstraints; 
 
                readerSettings.Schemas.Add(Schema);
                readerSettings.Schemas.Add(SoapBinding.Schema); 
                readerSettings.ValidationEventHandler += new ValidationEventHandler(InstanceValidation);
                warnings.Clear();
                XmlReader validatingReader = XmlReader.Create(reader, readerSettings);
                if (reader.ReadState != ReadState.Initial) { 
                    //underlying reader has moved, so move validatingreader as well
                    validatingReader.Read(); 
                } 
                ServiceDescription sd = (ServiceDescription)Serializer.Deserialize(validatingReader);
                sd.SetWarnings(warnings); 
                return sd;
            }
            else {
                return (ServiceDescription)Serializer.Deserialize(reader); 
            }
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public static bool CanRead(XmlReader reader) {
            return Serializer.CanDeserialize(reader); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public void Write(string fileName) {
            StreamWriter writer = new StreamWriter(fileName);
            try { 
                Write(writer);
            } 
            finally { 
                writer.Close();
            } 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public void Write(TextWriter writer) { 
            XmlTextWriter xmlWriter = new XmlTextWriter(writer);
            xmlWriter.Formatting = Formatting.Indented; 
            xmlWriter.Indentation = 2;
            Write(xmlWriter);
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public void Write(Stream stream) { 
            TextWriter writer = new StreamWriter(stream);
            Write(writer);
            writer.Flush();
        } 

 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public void Write(XmlWriter writer) {
            XmlSerializer serializer = Serializer;
            XmlSerializerNamespaces ns; 
            if (Namespaces == null || Namespaces.Count == 0) {
                ns = new XmlSerializerNamespaces(namespaces); 
                ns.Add(ServiceDescription.Prefix, ServiceDescription.Namespace); 
                if (this.TargetNamespace != null && this.TargetNamespace.Length != 0) {
                    ns.Add("tns", this.TargetNamespace); 
                }
                for (int i = 0; i < Types.Schemas.Count; i++) {
                    string tns = Types.Schemas[i].TargetNamespace;
                    if (tns != null && tns.Length > 0 && tns != this.TargetNamespace && tns != ServiceDescription.Namespace) { 
                        ns.Add("s" + i.ToString(CultureInfo.InvariantCulture), tns);
                    } 
                } 
                for (int i = 0; i < Imports.Count; i++) {
                    Import import = Imports[i]; 
                    if (import.Namespace.Length > 0) {
                        ns.Add("i" + i.ToString(CultureInfo.InvariantCulture), import.Namespace);
                    }
                } 
            }
            else { 
                ns = Namespaces; 
            }
            serializer.Serialize(writer, this, ns); 
        }

        internal static WsiProfiles GetConformanceClaims(XmlElement documentation) {
            if (documentation == null) 
                return WsiProfiles.None;
 
            WsiProfiles existingClaims = WsiProfiles.None; 

            XmlNode child = documentation.FirstChild; 
            while (child != null) {
                XmlNode sibling = child.NextSibling;
                if (child is XmlElement) {
                    XmlElement element = (XmlElement)child; 
                    if (element.LocalName == Soap.Element.Claim && element.NamespaceURI == Soap.ConformanceClaim) {
                        if (Soap.BasicProfile1_1 == element.GetAttribute(Soap.Attribute.ConformsTo)) { 
                            existingClaims |= WsiProfiles.BasicProfile1_1; 
                        }
                    } 
                }
                child = sibling;
            }
            return existingClaims; 
        }
 
        internal static void AddConformanceClaims(XmlElement documentation, WsiProfiles claims) { 
            //
            claims &= SupportedClaims; 
            if (claims == WsiProfiles.None)
                return;

            // check already presend claims 
            WsiProfiles existingClaims = GetConformanceClaims(documentation);
            claims &= ~existingClaims; 
            if (claims == WsiProfiles.None) 
                return;
 
            XmlDocument d = documentation.OwnerDocument;
            if ((claims & WsiProfiles.BasicProfile1_1) != 0) {
                XmlElement claim = d.CreateElement(Soap.ClaimPrefix, Soap.Element.Claim, Soap.ConformanceClaim);
                claim.SetAttribute(Soap.Attribute.ConformsTo, Soap.BasicProfile1_1); 
                documentation.InsertBefore(claim, null);
            } 
        } 
    }
 

    /// 
    /// 
    ///    [To be supplied.] 
    /// 
    [XmlFormatExtensionPoint("Extensions")] 
    public sealed class Import : DocumentableItem { 
        string ns;
        string location; 
        ServiceDescription parent;
        ServiceDescriptionFormatExtensionCollection extensions;

        internal void SetParent(ServiceDescription parent) { 
            this.parent = parent;
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions { 
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; }
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public ServiceDescription ServiceDescription {
            get { return parent; } 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        [XmlAttribute("namespace")]
        public string Namespace {
            get { return ns == null ? string.Empty : ns; } 
            set { ns = value; }
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        [XmlAttribute("location")]
        public string Location { 
            get { return location == null ? string.Empty : location; }
            set { location = value; } 
        } 
    }
 

    /// 
    /// 
    ///    [To be supplied.] 
    /// 
    public abstract class DocumentableItem { 
        XmlDocument parent; 
        string documentation;
        XmlElement documentationElement; 
        XmlAttribute[] anyAttribute;
        XmlSerializerNamespaces namespaces;

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        [XmlIgnore]
        public string Documentation { 
            get {
                if (documentation != null)
                    return documentation;
                if (documentationElement == null) 
                    return string.Empty;
                return documentationElement.InnerXml; 
            } 
            set {
                documentation = value; 
                StringWriter writer = new StringWriter(CultureInfo.InvariantCulture);
                XmlTextWriter xmlWriter = new XmlTextWriter(writer);
                xmlWriter.WriteElementString(ServiceDescription.Prefix, "documentation", ServiceDescription.Namespace, value);
                Parent.LoadXml(writer.ToString()); 
                documentationElement = parent.DocumentElement;
                xmlWriter.Close(); 
            } 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        [XmlAnyElement("documentation", Namespace=ServiceDescription.Namespace)]
        [ComVisible(false)] 
        public XmlElement DocumentationElement { 
            get { return documentationElement; }
            set { 
                documentationElement = value;
                documentation = null;
            }
        } 

        [XmlAnyAttribute] 
        public System.Xml.XmlAttribute[] ExtensibleAttributes { 
            get {
                return this.anyAttribute; 
            }
            set {
                this.anyAttribute = value;
            } 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        [XmlNamespaceDeclarations]
        public XmlSerializerNamespaces Namespaces {
            get { 
                if (this.namespaces == null)
                    this.namespaces = new XmlSerializerNamespaces(); 
                return this.namespaces; 
            }
            set { this.namespaces = value; } 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        [XmlIgnore] 
        public abstract ServiceDescriptionFormatExtensionCollection Extensions { get; }
 
        internal XmlDocument Parent {
            get {
                if (parent == null)
                    parent = new XmlDocument(); 
                return parent;
            } 
        } 

        internal XmlElement GetDocumentationElement() { 
            if (documentationElement == null) {
                documentationElement = Parent.CreateElement(ServiceDescription.Prefix, "documentation", ServiceDescription.Namespace);
                Parent.InsertBefore(documentationElement, null);
            } 
            return documentationElement;
        } 
    } 

    ///  
    /// 
    ///    [To be supplied.]
    /// 
    public abstract class NamedItem : DocumentableItem { 
        string name;
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        [XmlAttribute("name")]
        public string Name {
            get { return name; } 
            set { name = value; }
        } 
    } 

    ///  
    /// 
    ///    [To be supplied.]
    /// 
    [XmlFormatExtensionPoint("Extensions")] 
    public sealed class Port : NamedItem {
        ServiceDescriptionFormatExtensionCollection extensions; 
        XmlQualifiedName binding = XmlQualifiedName.Empty; 
        Service parent;
 
        internal void SetParent(Service parent) {
            this.parent = parent;
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public Service Service { 
            get { return parent; }
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions { 
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; }
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        [XmlAttribute("binding")]
        public XmlQualifiedName Binding { 
            get { return binding; }
            set { binding = value; }
        }
    } 

    ///  
    ///  
    ///    [To be supplied.]
    ///  
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class Service : NamedItem {
        ServiceDescriptionFormatExtensionCollection extensions;
        PortCollection ports; 
        ServiceDescription parent;
 
        internal void SetParent(ServiceDescription parent) { 
            this.parent = parent;
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public ServiceDescription ServiceDescription { 
            get { return parent; } 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions { 
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; } 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        [XmlElement("port")]
        public PortCollection Ports { 
            get { if (ports == null) ports = new PortCollection(this); return ports; } 
        }
    } 

    /// 
    /// 
    ///    [To be supplied.] 
    /// 
    [XmlFormatExtensionPoint("Extensions")] 
    public sealed class FaultBinding : MessageBinding { 
        ServiceDescriptionFormatExtensionCollection extensions;
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions { 
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; } 
        }
    } 

    /// 
    /// 
    ///    [To be supplied.] 
    /// 
    public abstract class MessageBinding : NamedItem { 
        OperationBinding parent; 

        internal void SetParent(OperationBinding parent) { 
            this.parent = parent;
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public OperationBinding OperationBinding {
            get { return parent; } 
        }
    }

    ///  
    /// 
    ///    [To be supplied.] 
    ///  
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class InputBinding : MessageBinding { 
        ServiceDescriptionFormatExtensionCollection extensions;

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        [XmlIgnore] 
        public override ServiceDescriptionFormatExtensionCollection Extensions {
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; } 
        }
    }

    ///  
    /// 
    ///    [To be supplied.] 
    ///  
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class OutputBinding : MessageBinding { 
        ServiceDescriptionFormatExtensionCollection extensions;

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        [XmlIgnore] 
        public override ServiceDescriptionFormatExtensionCollection Extensions {
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; } 
        }
    }

    ///  
    /// 
    ///    [To be supplied.] 
    ///  
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class OperationBinding : NamedItem { 
        ServiceDescriptionFormatExtensionCollection extensions;
        FaultBindingCollection faults;
        InputBinding input;
        OutputBinding output; 
        Binding parent;
 
        internal void SetParent(Binding parent) { 
            this.parent = parent;
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public Binding Binding { 
            get { return parent; } 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions { 
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; } 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        [XmlElement("input")]
        public InputBinding Input { 
            get { return input; } 
            set {
                if (input != null) { 
                    input.SetParent(null);
                }
                input = value;
                if (input != null) { 
                    input.SetParent(this);
                } 
            } 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        [XmlElement("output")]
        public OutputBinding Output { 
            get { return output; } 
            set {
                if (output != null) { 
                    output.SetParent(null);
                }
                output = value;
                if (output != null) { 
                    output.SetParent(this);
                } 
            } 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        [XmlElement("fault")]
        public FaultBindingCollection Faults { 
            get { if (faults == null) faults = new FaultBindingCollection(this); return faults; } 
        }
    } 

    /// 
    /// 
    ///    [To be supplied.] 
    /// 
    [XmlFormatExtensionPoint("Extensions")] 
    public sealed class Binding : NamedItem { 
        ServiceDescriptionFormatExtensionCollection extensions;
        OperationBindingCollection operations; 
        XmlQualifiedName type = XmlQualifiedName.Empty;
        ServiceDescription parent;

        internal void SetParent(ServiceDescription parent) { 
            this.parent = parent;
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public ServiceDescription ServiceDescription {
            get { return parent; } 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions {
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; } 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        [XmlElement("operation")]
        public OperationBindingCollection Operations {
            get { if (operations == null) operations = new OperationBindingCollection(this); return operations; } 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        [XmlAttribute("type")]
        public XmlQualifiedName Type {
            get { 
                if ((object)type == null) return XmlQualifiedName.Empty;
                return type; 
            } 
            set { type = value; }
        } 
    }

    /// 
    ///  
    ///    [To be supplied.]
    ///  
    public abstract class OperationMessage : NamedItem { 
        XmlQualifiedName message = XmlQualifiedName.Empty;
        Operation parent; 

        internal void SetParent(Operation parent) {
            this.parent = parent;
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public Operation Operation {
            get { return parent; }
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        [XmlAttribute("message")] 
        public XmlQualifiedName Message {
            get { return message; }
            set { message = value; }
        } 
    }
 
    ///  
    /// 
    ///    [To be supplied.] 
    /// 
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class OperationFault : OperationMessage {
        ServiceDescriptionFormatExtensionCollection extensions; 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions {
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; }
        } 
    }
 
    ///  
    /// 
    ///    [To be supplied.] 
    /// 
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class OperationInput : OperationMessage {
        ServiceDescriptionFormatExtensionCollection extensions; 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions {
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; }
        } 
    }
 
    ///  
    /// 
    ///    [To be supplied.] 
    /// 
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class OperationOutput : OperationMessage {
        ServiceDescriptionFormatExtensionCollection extensions; 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions {
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; }
        } 
    }
 
    ///  
    /// 
    ///    [To be supplied.] 
    /// 
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class Operation : NamedItem {
        string[] parameters; 
        OperationMessageCollection messages;
        OperationFaultCollection faults; 
        PortType parent; 
        ServiceDescriptionFormatExtensionCollection extensions;
 
        internal void SetParent(PortType parent) {
            this.parent = parent;
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        [XmlIgnore] 
        public override ServiceDescriptionFormatExtensionCollection Extensions {
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; }
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public PortType PortType { 
            get { return parent; }
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        [XmlAttribute("parameterOrder"), DefaultValue("")]
        public string ParameterOrderString { 
            get {
                if (parameters == null) return string.Empty;
                StringBuilder builder = new StringBuilder();
                for (int i = 0; i < parameters.Length; i++) { 
                    if (i > 0) builder.Append(' ');
                    builder.Append(parameters[i]); 
                } 
                return builder.ToString();
            } 
            set {
                if (value == null)
                    parameters = null;
                else 
                    parameters = value.Split(new char[] {' '});
            } 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        [XmlIgnore] 
        public string[] ParameterOrder {
            get { return parameters; } 
            set { parameters = value; } 
        }
 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        [XmlElement("input", typeof(OperationInput)), 
        XmlElement("output", typeof(OperationOutput))] 
        public OperationMessageCollection Messages {
            get { if (messages == null) messages = new OperationMessageCollection(this); return messages; } 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        [XmlElement("fault")] 
        public OperationFaultCollection Faults {
            get { if (faults == null) faults = new OperationFaultCollection(this); return faults; } 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public bool IsBoundBy(OperationBinding operationBinding) { 
            if (operationBinding.Name != Name) return false;
            OperationMessage input = Messages.Input; 
            if (input != null) {
                if (operationBinding.Input == null) return false;

                string portTypeInputName = GetMessageName(Name, input.Name, true); 
                string bindingInputName = GetMessageName(operationBinding.Name, operationBinding.Input.Name, true);
                if (bindingInputName != portTypeInputName) return false; 
            } 
            else if (operationBinding.Input != null)
                return false; 

            OperationMessage output = Messages.Output;
            if (output != null) {
                if (operationBinding.Output == null) return false; 

                string portTypeOutputName = GetMessageName(Name, output.Name, false); 
                string bindingOutputName = GetMessageName(operationBinding.Name, operationBinding.Output.Name, false); 
                if (bindingOutputName != portTypeOutputName) return false;
            } 
            else if (operationBinding.Output != null)
                return false;
            return true;
        } 

        private string GetMessageName(string operationName, string messageName, bool isInput){ 
            if (messageName != null && messageName.Length > 0) 
                return messageName;
 
            switch (Messages.Flow) {
            case OperationFlow.RequestResponse:
                if (isInput)
                    return operationName + "Request"; 
                return operationName + "Response";
            case OperationFlow.OneWay: 
                if (isInput) 
                    return operationName;
                Debug.Assert(isInput == true, "Oneway flow cannot have an output message"); 
                return null;
                /*Cases not supported
                case OperationFlow.SolicitResponse:
                    if (isInput) 
                        return operationName + "Solicit";
                    return operationName + "Response"; 
                case OperationFlow.Notification: 
                    if (!isInput)
                        return operationName; 
                    Debug.Assert(isInput == false, "Notification flow cannot have an input message");
                    return null;
                 */
            } 
            Debug.Assert(false, "Unknown message flow");
            return null; 
        } 
    }
 
    /// 
    /// 
    ///    [To be supplied.]
    ///  
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class PortType : NamedItem { 
        OperationCollection operations; 
        ServiceDescription parent;
        ServiceDescriptionFormatExtensionCollection extensions; 

        internal void SetParent(ServiceDescription parent) {
            this.parent = parent;
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions {
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; }
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public ServiceDescription ServiceDescription {
            get { return parent; }
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        [XmlElement("operation")] 
        public OperationCollection Operations {
            get { if (operations == null) operations = new OperationCollection(this); return operations; }
        }
    } 

    ///  
    ///  
    ///    [To be supplied.]
    ///  
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class Message : NamedItem {
        MessagePartCollection parts;
        ServiceDescription parent; 
        ServiceDescriptionFormatExtensionCollection extensions;
 
        internal void SetParent(ServiceDescription parent) { 
            this.parent = parent;
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        [XmlIgnore] 
        public override ServiceDescriptionFormatExtensionCollection Extensions { 
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; }
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public ServiceDescription ServiceDescription { 
            get { return parent; } 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        [XmlElement("part")]
        public MessagePartCollection Parts { 
            get { if (parts == null) parts = new MessagePartCollection(this); return parts; } 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public MessagePart[] FindPartsByName(string[] partNames) {
            MessagePart[] partArray = new MessagePart[partNames.Length]; 
            for (int i = 0; i < partNames.Length; i++) { 
                partArray[i] = FindPartByName(partNames[i]);
            } 
            return partArray;
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public MessagePart FindPartByName(string partName) {
            for (int i = 0; i < parts.Count; i++) { 
                MessagePart part = parts[i];
                if (part.Name == partName) return part;
            }
            throw new ArgumentException(Res.GetString(Res.MissingMessagePartForMessageFromNamespace3, partName, Name, ServiceDescription.TargetNamespace), "partName"); 
        }
    } 
 
    /// 
    ///  
    ///    [To be supplied.]
    /// 
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class MessagePart : NamedItem { 
        XmlQualifiedName type = XmlQualifiedName.Empty;
        XmlQualifiedName element = XmlQualifiedName.Empty; 
        Message parent; 
        ServiceDescriptionFormatExtensionCollection extensions;
 
        internal void SetParent(Message parent) {
            this.parent = parent;
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        [XmlIgnore] 
        public override ServiceDescriptionFormatExtensionCollection Extensions {
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; }
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public Message Message { 
            get { return parent; }
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        [XmlAttribute("element")]
        public XmlQualifiedName Element { 
            get { return element; }
            set { element = value; }
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        [XmlAttribute("type")] 
        public XmlQualifiedName Type {
            get {
                if ((object)type == null) return XmlQualifiedName.Empty;
                return type; 
            }
            set { type = value; } 
        } 
    }
 
    /// 
    /// 
    ///    [To be supplied.]
    ///  
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class Types : DocumentableItem { 
        XmlSchemas schemas; 
        ServiceDescriptionFormatExtensionCollection extensions;
 
        internal bool HasItems() {
            return (schemas != null && schemas.Count > 0) ||
                (extensions != null && extensions.Count > 0);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions {
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; }
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        [XmlElement("schema", typeof(XmlSchema), Namespace=XmlSchema.Namespace)]
        public XmlSchemas Schemas {
            get { if (schemas == null) schemas = new XmlSchemas(); return schemas; }
        } 
    }
 
    ///  
    /// 
    ///    [To be supplied.] 
    /// 
    public sealed class ServiceDescriptionFormatExtensionCollection : ServiceDescriptionBaseCollection {
        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public ServiceDescriptionFormatExtensionCollection(object parent) : base(parent) { } 

        ArrayList handledElements; 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public object this[int index] { 
            get { return (object)List[index]; } 
            set { List[index] = value; }
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public int Add(object extension) { 
            return List.Add(extension); 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public void Insert(int index, object extension) {
            List.Insert(index, extension); 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public int IndexOf(object extension) { 
            return List.IndexOf(extension);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public bool Contains(object extension) {
            return List.Contains(extension); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public void Remove(object extension) {
            List.Remove(extension);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public void CopyTo(object[] array, int index) {
            List.CopyTo(array, index);
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public object Find(Type type) { 
            for (int i = 0; i < List.Count; i++) {
                object item = List[i];
                if (type.IsAssignableFrom(item.GetType())) {
                    ((ServiceDescriptionFormatExtension)item).Handled = true; 
                    return item;
                } 
            } 
            return null;
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public object[] FindAll(Type type) { 
            ArrayList list = new ArrayList(); 
            for (int i = 0; i < List.Count; i++) {
                object item = List[i]; 
                if (type.IsAssignableFrom(item.GetType())) {
                    ((ServiceDescriptionFormatExtension)item).Handled = true;
                    list.Add(item);
                } 
            }
            return (object[])list.ToArray(type); 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public XmlElement Find(string name, string ns) { 
            for (int i = 0; i < List.Count; i++) {
                XmlElement element = List[i] as XmlElement; 
                if (element != null && element.LocalName == name && element.NamespaceURI == ns) { 
                    SetHandled(element);
                    return element; 
                }
            }
            return null;
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public XmlElement[] FindAll(string name, string ns) {
            ArrayList list = new ArrayList();
            for (int i = 0; i < List.Count; i++) {
                XmlElement element = List[i] as XmlElement; 
                if (element != null && element.LocalName == name && element.NamespaceURI == ns) {
                    SetHandled(element); 
                    list.Add(element); 
                }
            } 
            return (XmlElement[])list.ToArray(typeof(XmlElement));
        }

        void SetHandled(XmlElement element) { 
            if (handledElements == null)
                handledElements = new ArrayList(); 
            if (!handledElements.Contains(element)) 
                handledElements.Add(element);
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public bool IsHandled(object item) { 
            if (item is XmlElement) 
                return IsHandled((XmlElement)item);
            else 
                return ((ServiceDescriptionFormatExtension)item).Handled;
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public bool IsRequired(object item) {
            if (item is XmlElement) 
                return IsRequired((XmlElement)item);
            else
                return ((ServiceDescriptionFormatExtension)item).Required;
        } 

        bool IsHandled(XmlElement element) { 
            if (handledElements == null) return false; 
            return handledElements.Contains(element);
        } 

        bool IsRequired(XmlElement element) {
            XmlAttribute requiredAttr = element.Attributes["required", ServiceDescription.Namespace];
            if (requiredAttr == null || requiredAttr.Value == null) { 
                requiredAttr = element.Attributes["required"];
                if (requiredAttr == null || requiredAttr.Value == null) return false; // not required, by default 
            } 
            return XmlConvert.ToBoolean(requiredAttr.Value);
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        protected override void SetParent(object value, object parent) { 
            if (value is ServiceDescriptionFormatExtension) ((ServiceDescriptionFormatExtension)value).SetParent(parent); 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        protected override void OnValidate(object value) {
            if (!(value is XmlElement || value is ServiceDescriptionFormatExtension)) 
                throw new ArgumentException(Res.GetString(Res.OnlyXmlElementsOrTypesDerivingFromServiceDescriptionFormatExtension0), "value"); 
            base.OnValidate(value);
        } 
    }

    /// 
    ///  
    ///    [To be supplied.]
    ///  
    public abstract class ServiceDescriptionFormatExtension { 
        object parent;
        bool required; 
        bool handled;

        internal void SetParent(object parent) {
            this.parent = parent; 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public object Parent {
            get { return parent; }
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        [XmlAttribute("required", Namespace=ServiceDescription.Namespace), DefaultValue(false)]
        public bool Required {
            get { return required; }
            set { required = value; } 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        [XmlIgnore]
        public bool Handled {
            get { return handled; } 
            set { handled = value; }
        } 
    } 

    ///  
    /// 
    ///    [To be supplied.]
    /// 
    public enum OperationFlow { 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        None, 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        OneWay,
        ///  
        ///  
        ///    [To be supplied.]
        ///  
        Notification,
        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        RequestResponse, 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        SolicitResponse,
    }
 
    /// 
    ///  
    ///    [To be supplied.] 
    /// 
    public sealed class OperationMessageCollection : ServiceDescriptionBaseCollection { 
        internal OperationMessageCollection(Operation operation) : base(operation) { }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public OperationMessage this[int index] { 
            get { return (OperationMessage)List[index]; }
            set { List[index] = value; } 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public int Add(OperationMessage operationMessage) { 
            return List.Add(operationMessage);
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public void Insert(int index, OperationMessage operationMessage) { 
            List.Insert(index, operationMessage); 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public int IndexOf(OperationMessage operationMessage) {
            return List.IndexOf(operationMessage); 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public bool Contains(OperationMessage operationMessage) { 
            return List.Contains(operationMessage);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public void Remove(OperationMessage operationMessage) {
            List.Remove(operationMessage); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public void CopyTo(OperationMessage[] array, int index) {
            List.CopyTo(array, index);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public OperationInput Input {
            get {
                for (int i = 0; i < List.Count; i++) {
                    OperationInput input = List[i] as OperationInput; 
                    if (input != null) {
                        return input; 
                    } 
                }
                return null; 
            }
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public OperationOutput Output {
            get { 
                for (int i = 0; i < List.Count; i++) {
                    OperationOutput output = List[i] as OperationOutput;
                    if (output != null) {
                        return output; 
                    }
                } 
                return null; 
            }
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public OperationFlow Flow { 
            get { 
                if (List.Count == 0) {
                    return OperationFlow.None; 
                }
                else if (List.Count == 1) {
                    if (List[0] is OperationInput) {
                        return OperationFlow.OneWay; 
                    }
                    else { 
                        return OperationFlow.Notification; 
                    }
                } 
                else {
                    if (List[0] is OperationInput) {
                        return OperationFlow.RequestResponse;
                    } 
                    else {
                        return OperationFlow.SolicitResponse; 
                    } 
                }
            } 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        protected override void SetParent(object value, object parent) { 
            ((OperationMessage)value).SetParent((Operation)parent);
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        protected override void OnInsert(int index, object value) { 
            if (Count > 1 || (Count == 1 && value.GetType() == List[0].GetType())) 
                throw new InvalidOperationException(Res.GetString(Res.WebDescriptionTooManyMessages));
 
            base.OnInsert(index, value);
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        protected override void OnSet(int index, object oldValue, object newValue) {
            if (oldValue.GetType() != newValue.GetType()) throw new InvalidOperationException(Res.GetString(Res.WebDescriptionTooManyMessages)); 
            base.OnSet(index, oldValue, newValue);
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        protected override void OnValidate(object value) {
            if (!(value is OperationInput || value is OperationOutput)) 
                throw new ArgumentException(Res.GetString(Res.OnlyOperationInputOrOperationOutputTypes), "value");
            base.OnValidate(value);
        }
    } 

    ///  
    ///  
    ///    [To be supplied.]
    ///  
    public sealed class ImportCollection : ServiceDescriptionBaseCollection {
        internal ImportCollection(ServiceDescription serviceDescription) : base(serviceDescription) { }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public Import this[int index] {
            get { return (Import)List[index]; } 
            set { List[index] = value; }
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public int Add(Import import) {
            return List.Add(import); 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public void Insert(int index, Import import) { 
            List.Insert(index, import);
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public int IndexOf(Import import) { 
            return List.IndexOf(import); 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public bool Contains(Import import) {
            return List.Contains(import); 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public void Remove(Import import) { 
            List.Remove(import);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public void CopyTo(Import[] array, int index) {
            List.CopyTo(array, index); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        protected override void SetParent(object value, object parent) {
            ((Import)value).SetParent((ServiceDescription)parent);
        } 
    }
 
    ///  
    /// 
    ///    [To be supplied.] 
    /// 
    public sealed class MessageCollection : ServiceDescriptionBaseCollection {
        internal MessageCollection(ServiceDescription serviceDescription) : base(serviceDescription) { }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public Message this[int index] { 
            get { return (Message)List[index]; }
            set { List[index] = value; }
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public int Add(Message message) { 
            return List.Add(message);
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public void Insert(int index, Message message) {
            List.Insert(index, message); 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public int IndexOf(Message message) { 
            return List.IndexOf(message);
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public bool Contains(Message message) { 
            return List.Contains(message); 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public void Remove(Message message) {
            List.Remove(message); 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public void CopyTo(Message[] array, int index) { 
            List.CopyTo(array, index);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public Message this[string name] {
            get { return (Message)Table[name]; } 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        protected override string GetKey(object value) {
            return ((Message)value).Name;
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        protected override void SetParent(object value, object parent) {
            ((Message)value).SetParent((ServiceDescription)parent);
        }
    } 

    ///  
    ///  
    ///    [To be supplied.]
    ///  
    public sealed class PortCollection : ServiceDescriptionBaseCollection {
        internal PortCollection(Service service) : base(service) { }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public Port this[int index] {
            get { return (Port)List[index]; } 
            set { List[index] = value; }
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public int Add(Port port) {
            return List.Add(port); 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public void Insert(int index, Port port) { 
            List.Insert(index, port);
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public int IndexOf(Port port) { 
            return List.IndexOf(port); 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public bool Contains(Port port) {
            return List.Contains(port); 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public void Remove(Port port) { 
            List.Remove(port);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public void CopyTo(Port[] array, int index) {
            List.CopyTo(array, index); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public Port this[string name] {
            get { return (Port)Table[name]; }
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        protected override string GetKey(object value) {
            return ((Port)value).Name;
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        protected override void SetParent(object value, object parent) { 
            ((Port)value).SetParent((Service)parent);
        }
    }
 
    /// 
    ///  
    ///    [To be supplied.] 
    /// 
    public sealed class PortTypeCollection : ServiceDescriptionBaseCollection { 
        internal PortTypeCollection(ServiceDescription serviceDescription) : base(serviceDescription) { }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public PortType this[int index] { 
            get { return (PortType)List[index]; }
            set { List[index] = value; } 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public int Add(PortType portType) { 
            return List.Add(portType);
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public void Insert(int index, PortType portType) { 
            List.Insert(index, portType); 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public int IndexOf(PortType portType) {
            return List.IndexOf(portType); 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public bool Contains(PortType portType) { 
            return List.Contains(portType);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public void Remove(PortType portType) {
            List.Remove(portType); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public void CopyTo(PortType[] array, int index) {
            List.CopyTo(array, index);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public PortType this[string name] {
            get { return (PortType)Table[name]; }
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        protected override string GetKey(object value) { 
            return ((PortType)value).Name;
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        protected override void SetParent(object value, object parent) {
            ((PortType)value).SetParent((ServiceDescription)parent); 
        }
    }

    ///  
    /// 
    ///    [To be supplied.] 
    ///  
    public sealed class BindingCollection : ServiceDescriptionBaseCollection {
        internal BindingCollection(ServiceDescription serviceDescription) : base(serviceDescription) { } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public Binding this[int index] { 
            get { return (Binding)List[index]; } 
            set { List[index] = value; }
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public int Add(Binding binding) { 
            return List.Add(binding); 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public void Insert(int index, Binding binding) {
            List.Insert(index, binding); 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public int IndexOf(Binding binding) { 
            return List.IndexOf(binding);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public bool Contains(Binding binding) {
            return List.Contains(binding); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public void Remove(Binding binding) {
            List.Remove(binding);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public void CopyTo(Binding[] array, int index) {
            List.CopyTo(array, index);
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public Binding this[string name] { 
            get { return (Binding)Table[name]; }
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        protected override string GetKey(object value) {
            return ((Binding)value).Name; 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        protected override void SetParent(object value, object parent) { 
            ((Binding)value).SetParent((ServiceDescription)parent);
        } 
    }

    /// 
    ///  
    ///    [To be supplied.]
    ///  
    public sealed class ServiceCollection : ServiceDescriptionBaseCollection { 
        internal ServiceCollection(ServiceDescription serviceDescription) : base(serviceDescription) { }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public Service this[int index] {
            get { return (Service)List[index]; } 
            set { List[index] = value; } 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public int Add(Service service) {
            return List.Add(service); 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public void Insert(int index, Service service) { 
            List.Insert(index, service);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public int IndexOf(Service service) {
            return List.IndexOf(service); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public bool Contains(Service service) {
            return List.Contains(service);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public void Remove(Service service) {
            List.Remove(service);
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public void CopyTo(Service[] array, int index) { 
            List.CopyTo(array, index);
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public Service this[string name] {
            get { return (Service)Table[name]; } 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        protected override string GetKey(object value) { 
            return ((Service)value).Name;
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        protected override void SetParent(object value, object parent) { 
            ((Service)value).SetParent((ServiceDescription)parent); 
        }
    } 

    /// 
    /// 
    ///    [To be supplied.] 
    /// 
    public sealed class MessagePartCollection : ServiceDescriptionBaseCollection { 
        internal MessagePartCollection(Message message) : base(message) { } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public MessagePart this[int index] { 
            get { return (MessagePart)List[index]; }
            set { List[index] = value; } 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public int Add(MessagePart messagePart) { 
            return List.Add(messagePart);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public void Insert(int index, MessagePart messagePart) {
            List.Insert(index, messagePart); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public int IndexOf(MessagePart messagePart) {
            return List.IndexOf(messagePart);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public bool Contains(MessagePart messagePart) {
            return List.Contains(messagePart);
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public void Remove(MessagePart messagePart) { 
            List.Remove(messagePart);
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public void CopyTo(MessagePart[] array, int index) {
            List.CopyTo(array, index); 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public MessagePart this[string name] { 
            get { return (MessagePart)Table[name]; }
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        protected override string GetKey(object value) { 
            return ((MessagePart)value).Name; 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        protected override void SetParent(object value, object parent) {
            ((MessagePart)value).SetParent((Message)parent); 
        } 
    }
 
    /// 
    /// 
    ///    [To be supplied.]
    ///  
    public sealed class OperationBindingCollection : ServiceDescriptionBaseCollection {
        internal OperationBindingCollection(Binding binding) : base(binding) { } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public OperationBinding this[int index] {
            get { return (OperationBinding)List[index]; } 
            set { List[index] = value; }
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public int Add(OperationBinding bindingOperation) {
            return List.Add(bindingOperation); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public void Insert(int index, OperationBinding bindingOperation) {
            List.Insert(index, bindingOperation);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public int IndexOf(OperationBinding bindingOperation) {
            return List.IndexOf(bindingOperation);
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public bool Contains(OperationBinding bindingOperation) { 
            return List.Contains(bindingOperation);
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public void Remove(OperationBinding bindingOperation) {
            List.Remove(bindingOperation); 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public void CopyTo(OperationBinding[] array, int index) { 
            List.CopyTo(array, index);
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        protected override void SetParent(object value, object parent) { 
            ((OperationBinding)value).SetParent((Binding)parent); 
        }
    } 

    /// 
    /// 
    ///    [To be supplied.] 
    /// 
    public sealed class FaultBindingCollection : ServiceDescriptionBaseCollection { 
        internal FaultBindingCollection(OperationBinding operationBinding) : base(operationBinding) { } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public FaultBinding this[int index] { 
            get { return (FaultBinding)List[index]; }
            set { List[index] = value; } 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public int Add(FaultBinding bindingOperationFault) { 
            return List.Add(bindingOperationFault);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public void Insert(int index, FaultBinding bindingOperationFault) {
            List.Insert(index, bindingOperationFault); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public int IndexOf(FaultBinding bindingOperationFault) {
            return List.IndexOf(bindingOperationFault);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public bool Contains(FaultBinding bindingOperationFault) {
            return List.Contains(bindingOperationFault);
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public void Remove(FaultBinding bindingOperationFault) { 
            List.Remove(bindingOperationFault);
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public void CopyTo(FaultBinding[] array, int index) {
            List.CopyTo(array, index); 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public FaultBinding this[string name] { 
            get { return (FaultBinding)Table[name]; }
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        protected override string GetKey(object value) { 
            return ((FaultBinding)value).Name; 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        protected override void SetParent(object value, object parent) {
            ((FaultBinding)value).SetParent((OperationBinding)parent); 
        } 
    }
 
    /// 
    /// 
    ///    [To be supplied.]
    ///  
    public sealed class OperationCollection : ServiceDescriptionBaseCollection {
        internal OperationCollection(PortType portType) : base(portType) { } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public Operation this[int index] {
            get { return (Operation)List[index]; } 
            set { List[index] = value; }
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public int Add(Operation operation) {
            return List.Add(operation); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public void Insert(int index, Operation operation) {
            List.Insert(index, operation);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public int IndexOf(Operation operation) {
            return List.IndexOf(operation);
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public bool Contains(Operation operation) { 
            return List.Contains(operation);
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public void Remove(Operation operation) {
            List.Remove(operation); 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public void CopyTo(Operation[] array, int index) { 
            List.CopyTo(array, index);
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        protected override void SetParent(object value, object parent) { 
            ((Operation)value).SetParent((PortType)parent); 
        }
    } 

    /// 
    /// 
    ///    [To be supplied.] 
    /// 
    public sealed class OperationFaultCollection : ServiceDescriptionBaseCollection { 
        internal OperationFaultCollection(Operation operation) : base(operation) { } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public OperationFault this[int index] { 
            get { return (OperationFault)List[index]; }
            set { List[index] = value; } 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public int Add(OperationFault operationFaultMessage) { 
            return List.Add(operationFaultMessage);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public void Insert(int index, OperationFault operationFaultMessage) {
            List.Insert(index, operationFaultMessage); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public int IndexOf(OperationFault operationFaultMessage) {
            return List.IndexOf(operationFaultMessage);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public bool Contains(OperationFault operationFaultMessage) {
            return List.Contains(operationFaultMessage);
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public void Remove(OperationFault operationFaultMessage) { 
            List.Remove(operationFaultMessage);
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public void CopyTo(OperationFault[] array, int index) {
            List.CopyTo(array, index); 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public OperationFault this[string name] { 
            get { return (OperationFault)Table[name]; }
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        protected override string GetKey(object value) { 
            return ((OperationFault)value).Name; 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        protected override void SetParent(object value, object parent) {
            ((OperationFault)value).SetParent((Operation)parent); 
        } 
    }
 
    /// 
    /// 
    ///    [To be supplied.]
    ///  
    public abstract class ServiceDescriptionBaseCollection : CollectionBase {
        Hashtable table; // 
        object parent; 

        internal ServiceDescriptionBaseCollection(object parent) { 
            this.parent = parent;
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        protected virtual IDictionary Table {
            get { if (table == null) table = new Hashtable(); return table; } 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        protected virtual string GetKey(object value) { 
            return null; // returning null means there is no key
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        protected virtual void SetParent(object value, object parent) { 
            // default is that the item has no parent 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        protected override void OnInsertComplete(int index, object value) {
            AddValue(value); 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        protected override void OnRemove(int index, object value) { 
            RemoveValue(value);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        protected override void OnClear() {
            for (int i = 0; i < List.Count; i++) { 
                RemoveValue(List[i]);
            } 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        protected override void OnSet(int index, object oldValue, object newValue) { 
            RemoveValue(oldValue);
            AddValue(newValue); 
        } 

        void AddValue(object value) { 
            string key = GetKey(value);
            if (key != null) {
                try {
                    Table.Add(key, value); 
                }
                catch (Exception e) { 
                    if (e is ThreadAbortException || e is StackOverflowException || e is OutOfMemoryException) { 
                        throw;
                    } 
                    if (Table[key] != null) {
                        throw new ArgumentException(GetDuplicateMessage(value.GetType(), key), e.InnerException);
                    }
                    else { 
                        throw e;
                    } 
                } 
            }
            SetParent(value, parent); 
        }

        void RemoveValue(object value) {
            string key = GetKey(value); 
            if (key != null) Table.Remove(key);
            SetParent(value, null); 
        } 

        static string GetDuplicateMessage(Type type, string elemName) { 
            string message = null;
            if (type == typeof(ServiceDescriptionFormatExtension))
                message = Res.GetString(Res.WebDuplicateFormatExtension, elemName);
            else if (type == typeof(OperationMessage)) 
                message = Res.GetString(Res.WebDuplicateOperationMessage, elemName);
            else if (type == typeof(Import)) 
                message = Res.GetString(Res.WebDuplicateImport, elemName); 
            else if (type == typeof(Message))
                message = Res.GetString(Res.WebDuplicateMessage, elemName); 
            else if (type == typeof(Port))
                message = Res.GetString(Res.WebDuplicatePort, elemName);
            else if (type == typeof(PortType))
                message = Res.GetString(Res.WebDuplicatePortType, elemName); 
            else if (type == typeof(Binding))
                message = Res.GetString(Res.WebDuplicateBinding, elemName); 
            else if (type == typeof(Service)) 
                message = Res.GetString(Res.WebDuplicateService, elemName);
            else if (type == typeof(MessagePart)) 
                message = Res.GetString(Res.WebDuplicateMessagePart, elemName);
            else if (type == typeof(OperationBinding))
                message = Res.GetString(Res.WebDuplicateOperationBinding, elemName);
            else if (type == typeof(FaultBinding)) 
                message = Res.GetString(Res.WebDuplicateFaultBinding, elemName);
            else if (type == typeof(Operation)) 
                message = Res.GetString(Res.WebDuplicateOperation, elemName); 
            else if (type == typeof(OperationFault))
                message = Res.GetString(Res.WebDuplicateOperationFault, elemName); 
            else
                message = Res.GetString(Res.WebDuplicateUnknownElement, type, elemName);

            return message; 
        }
    } 
 
    internal class Schemas {
        Schemas() {} 
        internal const string Wsdl = @"

 
   
    
       
    
  

   
    
       
      This type is extended by  component types to allow them to be documented 
      
     
    
      
    
   
 
  
     
      
         
          
          This type is extended by component types to allow attributes from other namespaces to be added.
          
         
        
           
         
        
       
    
  
  
     
      
         
           
          This type is extended by component types to allow elements from other namespaces to be added.
           
        
        
          
         
        
       
     
  
  
  
    
       
      
     
     
      
       
    
    
      
       
    
     
       
      
     
    
      
      
     
  
 
   
    
       
      Any top level optional element allowed to appear more then once - any child of definitions element except wsdl:types. Any extensibility element is allowed in any place.
      
    
     
      
       
       
        
           
          
        
      
       
      
       
         
          
           
        
	  
    
   

   
     
      
         
          
        
        
         
      
     
   

   
    
      
        
         
      
     
   

   
    
      
    
   

   
     
      
         
          
        
        
       
    
   
 
  
     
      
        
        
         
      
     
   

   
    
      
        
           
        
         
       
    
   

  
    
       
	    
           
             
            
           
        
        
        
       
    
   
 
  
     
      
 	  
	    
 		 
      
     
   

   
    
      
 	  
	     
 		
	   
     
  
 
  
    
      
         
        
       
     
  
 
  
    
      
         
        
       
     
  
 
  
    
      
         
          
         
         
        
       
    
  

   
    
       
         
      
     
  

  
     
      
         
       
    
   

  
    
       
        
           
           
          
         
        
      
    
   

   
     
      
         
          
        
        
       
    
   
 
  
     
      
        
        
       
    
   
 
  
   
  
    
  
 
";
 
        internal const string Soap = @" 

   
  
    
      
      'encodingStyle' indicates any canonicalization conventions followed in the contents of the containing element.  For example, the value 'http://schemas.xmlsoap.org/soap/encoding/' indicates the pattern described in SOAP specification 
      
     
     
  
   
  
    
      
         
        
       
     
  
   
    
      
      
     
  
   
   
    
       
        
        
      
     
  
   
   
    
     
    
  
  
     
      
         
         
      
     
  
  
    
       
      
     
   
  
   
    
      
        
         
        
       
     
  
   
    
      
        
       
    
   
   
  
     
    
    
    
     
  
   
     
      
         
          
        
        
       
    
   
   
  
     
  
  
  
     
      
         
       
    
   
";

        internal const string WebRef = @"
 
  
     
       
        
           
          
          
          
           
        
       
     
  
   
    
      
      
       
    
   
   
    
       
      
      
      
         
          
             
           
        
       
    
  
  
   
    
       
       
      
       
      
      
      
       
      
       
       
      
       
      
      
      
       
      
         
           
            
           
        
      
    
   
  
"; 
 
        internal const string SoapEncoding = @"


  
   
      
	    
	 
    
 

  
     
    
     
   

   
    
  

   
  
 
   
    
     
  

  
 
  
     
   

   
    
      
 	
   

   
   
    
     
    
  
  
   
    
       
	 
  
 
  
    
    
   

   
     
  
 
  
  
    
       
        
       
     
  
 
  
  
    
       
        
       
     
  
 


  
   
    
       
         
      
     
  


   
  
     
       
        
       
    
  

   
  
     
       
        
       
    
  

   
  
     
       
        
       
    
  

   
  
     
       
        
       
    
  

   
  
     
       
        
       
    
  

   
  
     
       
        
       
    
  

   
  
     
       
        
       
    
  

   
  
     
       
        
       
    
  

   
  
     
       
        
       
    
  

   
  
     
      
       
      
    
  

   
  
     
       
        
       
    
  

   
  
     
       
        
       
    
  

   
  
     
       
        
       
    
  

   
  
     
       
        
       
    
  

 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
"; 
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------ 
// 
//     Copyright (c) Microsoft Corporation.  All rights reserved.
// 
//----------------------------------------------------------------------------- 

namespace System.Web.Services.Description { 
 
    using System.Xml.Serialization;
    using System.Xml.Schema; 
    using System.Collections;
    using System.Collections.Specialized;
    using System;
    using System.Xml; 
    using System.IO;
    using System.Reflection; 
    using System.ComponentModel; 
    using System.CodeDom;
    using System.Text; 
    using System.Web.Services.Configuration;
    using System.Diagnostics;
    using System.Threading;
    using System.Globalization; 
    using System.Runtime.InteropServices;
    using System.Web.Services.Protocols; 
 
    /// 
    ///  
    ///
    /// 
    [XmlRoot("definitions", Namespace=ServiceDescription.Namespace)]
    [XmlFormatExtensionPoint("Extensions")] 
    public sealed class ServiceDescription : NamedItem {
        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public const string Namespace = "http://schemas.xmlsoap.org/wsdl/";
        internal const string Prefix = "wsdl";
        Types types;
        ImportCollection imports; 
        MessageCollection messages;
        PortTypeCollection portTypes; 
        BindingCollection bindings; 
        ServiceCollection services;
        string targetNamespace; 
        ServiceDescriptionFormatExtensionCollection extensions;
        ServiceDescriptionCollection parent;
        string appSettingUrlKey;
        string appSettingBaseUrl; 
        string retrievalUrl;
        static XmlSerializer serializer; 
        static XmlSerializerNamespaces namespaces; 
        const WsiProfiles SupportedClaims = WsiProfiles.BasicProfile1_1;
        static XmlSchema schema = null; 
        static XmlSchema soapEncodingSchema = null;
        StringCollection validationWarnings;
        static StringCollection warnings = new StringCollection();
        ServiceDescription next; 

        private static void InstanceValidation (object sender, ValidationEventArgs args) { 
            warnings.Add(Res.GetString(Res.WsdlInstanceValidationDetails, args.Message, args.Exception.LineNumber.ToString(CultureInfo.InvariantCulture), args.Exception.LinePosition.ToString(CultureInfo.InvariantCulture))); 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        [XmlIgnore]
        public string RetrievalUrl { 
            get { return retrievalUrl == null ? string.Empty : retrievalUrl; } 
            set { retrievalUrl = value; }
        } 

        internal void SetParent(ServiceDescriptionCollection parent) {
            this.parent = parent;
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        [XmlIgnore]
        public ServiceDescriptionCollection ServiceDescriptions {
            get { return parent; }
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions {
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; }
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        [XmlElement("import")]
        public ImportCollection Imports {
            get { if (imports == null) imports = new ImportCollection(this); return imports; }
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        [XmlElement("types")]
        public Types Types {
            get { if (types == null) types = new Types(); return types; }
            set { types = value; } 
        }
 
        private bool ShouldSerializeTypes() { return Types.HasItems(); } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        [XmlElement("message")] 
        public MessageCollection Messages {
            get { if (messages == null) messages = new MessageCollection(this); return messages; } 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        [XmlElement("portType")] 
        public PortTypeCollection PortTypes {
            get { if (portTypes == null) portTypes = new PortTypeCollection(this); return portTypes; } 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        [XmlElement("binding")] 
        public BindingCollection Bindings {
            get { if (bindings == null) bindings = new BindingCollection(this); return bindings; } 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        [XmlElement("service")] 
        public ServiceCollection Services {
            get { if (services == null) services = new ServiceCollection(this); return services; } 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        [XmlAttribute("targetNamespace")] 
        public string TargetNamespace {
            get { return targetNamespace; } 
            set { targetNamespace = value; } 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public static XmlSchema Schema {
            get { 
                if (schema == null) { 
                    schema = XmlSchema.Read(new StringReader(Schemas.Wsdl), null);
                } 
                return schema;
            }
        }
 
        internal static XmlSchema SoapEncodingSchema {
            get { 
                if (soapEncodingSchema == null) { 
                    soapEncodingSchema = XmlSchema.Read(new StringReader(Schemas.SoapEncoding), null);
                } 
                return soapEncodingSchema;
            }
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        [XmlIgnore] 
        public StringCollection ValidationWarnings {
            get {
                if (validationWarnings == null) {
                    validationWarnings = new StringCollection(); 
                }
                return validationWarnings; 
            } 
        }
 
        internal void SetWarnings(StringCollection warnings) {
            this.validationWarnings = warnings;
        }
 
        // This is a special serializer that hardwires to the generated
        // ServiceDescriptionSerializer. To regenerate the serializer 
        // Turn on KEEPTEMPFILES 
        // Restart server
        // Run wsdl as follows 
        //   wsdl ?wsdl
        // Goto windows temp dir (usually \winnt\temp)
        // and get the latest generated .cs file
        // Change namespace to 'System.Web.Services.Description' 
        // Change class names to ServiceDescriptionSerializationWriter
        // and ServiceDescriptionSerializationReader 
        // Make the classes internal 
        // Ensure the public Write method is Write125_definitions (If not
        // change Serialize to call the new one) 
        // Ensure the public Read method is Read126_definitions (If not
        // change Deserialize to call the new one)
        internal class ServiceDescriptionSerializer : XmlSerializer {
            protected override XmlSerializationReader CreateReader() { 
                return new ServiceDescriptionSerializationReader();
            } 
            protected override XmlSerializationWriter CreateWriter() { 
                return new ServiceDescriptionSerializationWriter();
            } 
            public override bool CanDeserialize(System.Xml.XmlReader xmlReader){
                return xmlReader.IsStartElement("definitions", ServiceDescription.Namespace);
            }
            protected override void Serialize(Object objectToSerialize, XmlSerializationWriter writer){ 
                ((ServiceDescriptionSerializationWriter)writer).Write125_definitions(objectToSerialize);
            } 
            protected override object Deserialize(XmlSerializationReader reader){ 
                return ((ServiceDescriptionSerializationReader)reader).Read125_definitions();
            } 
        }
        /// 
        /// 
        /// Returns the serializer for processing web service calls.  The serializer is customized according 
        /// to settings in config.web.
        ///  
        ///  
        /// 
        [XmlIgnore] 
        public static XmlSerializer Serializer {
            get {
                if (serializer == null) {
                    WebServicesSection config = WebServicesSection.Current; 
                    XmlAttributeOverrides overrides = new XmlAttributeOverrides();
                    XmlSerializerNamespaces ns = new XmlSerializerNamespaces(); 
                    ns.Add("s", XmlSchema.Namespace); 
                    WebServicesSection.LoadXmlFormatExtensions(config.GetAllFormatExtensionTypes(), overrides, ns);
                    namespaces = ns; 
                    if (config.ServiceDescriptionExtended)
                        serializer = new XmlSerializer(typeof(ServiceDescription), overrides);
                    else
                        serializer = new ServiceDescriptionSerializer(); 
                    serializer.UnknownElement += new XmlElementEventHandler(RuntimeUtils.OnUnknownElement);
                } 
                return serializer; 
            }
        } 

        internal string AppSettingBaseUrl {
            get { return appSettingBaseUrl; }
            set { appSettingBaseUrl = value; } 
        }
 
        internal string AppSettingUrlKey { 
            get { return appSettingUrlKey; }
            set { appSettingUrlKey = value; } 
        }

        internal ServiceDescription Next {
            get { return next; } 
            set { next = value; }
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public static ServiceDescription Read(TextReader textReader) {
            return Read(textReader, false); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public static ServiceDescription Read(Stream stream) {
            return Read(stream, false);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public static ServiceDescription Read(XmlReader reader) {
            return Read(reader, false);
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public static ServiceDescription Read(string fileName) { 
            return Read(fileName, false);
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public static ServiceDescription Read(TextReader textReader, bool validate) {
            XmlTextReader reader = new XmlTextReader(textReader);	 
            reader.WhitespaceHandling = WhitespaceHandling.Significant;
            reader.XmlResolver = null;
            reader.DtdProcessing = DtdProcessing.Prohibit;
            return Read(reader, validate); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public static ServiceDescription Read(Stream stream, bool validate) {
            XmlTextReader reader = new XmlTextReader(stream);
            reader.WhitespaceHandling = WhitespaceHandling.Significant; 
            reader.XmlResolver = null;
            reader.DtdProcessing = DtdProcessing.Prohibit; 
            return Read(reader, validate); 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public static ServiceDescription Read(string fileName, bool validate) {
            StreamReader reader = new StreamReader(fileName, Encoding.Default, true); 
            try { 
                return Read(reader, validate);
            } 
            finally {
                reader.Close();
            }
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public static ServiceDescription Read(XmlReader reader, bool validate) {
            if (validate) {
                XmlReaderSettings readerSettings = new XmlReaderSettings();
 
 				readerSettings.ValidationType = ValidationType.Schema;
				readerSettings.ValidationFlags = XmlSchemaValidationFlags.ProcessIdentityConstraints; 
 
                readerSettings.Schemas.Add(Schema);
                readerSettings.Schemas.Add(SoapBinding.Schema); 
                readerSettings.ValidationEventHandler += new ValidationEventHandler(InstanceValidation);
                warnings.Clear();
                XmlReader validatingReader = XmlReader.Create(reader, readerSettings);
                if (reader.ReadState != ReadState.Initial) { 
                    //underlying reader has moved, so move validatingreader as well
                    validatingReader.Read(); 
                } 
                ServiceDescription sd = (ServiceDescription)Serializer.Deserialize(validatingReader);
                sd.SetWarnings(warnings); 
                return sd;
            }
            else {
                return (ServiceDescription)Serializer.Deserialize(reader); 
            }
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public static bool CanRead(XmlReader reader) {
            return Serializer.CanDeserialize(reader); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public void Write(string fileName) {
            StreamWriter writer = new StreamWriter(fileName);
            try { 
                Write(writer);
            } 
            finally { 
                writer.Close();
            } 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public void Write(TextWriter writer) { 
            XmlTextWriter xmlWriter = new XmlTextWriter(writer);
            xmlWriter.Formatting = Formatting.Indented; 
            xmlWriter.Indentation = 2;
            Write(xmlWriter);
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public void Write(Stream stream) { 
            TextWriter writer = new StreamWriter(stream);
            Write(writer);
            writer.Flush();
        } 

 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public void Write(XmlWriter writer) {
            XmlSerializer serializer = Serializer;
            XmlSerializerNamespaces ns; 
            if (Namespaces == null || Namespaces.Count == 0) {
                ns = new XmlSerializerNamespaces(namespaces); 
                ns.Add(ServiceDescription.Prefix, ServiceDescription.Namespace); 
                if (this.TargetNamespace != null && this.TargetNamespace.Length != 0) {
                    ns.Add("tns", this.TargetNamespace); 
                }
                for (int i = 0; i < Types.Schemas.Count; i++) {
                    string tns = Types.Schemas[i].TargetNamespace;
                    if (tns != null && tns.Length > 0 && tns != this.TargetNamespace && tns != ServiceDescription.Namespace) { 
                        ns.Add("s" + i.ToString(CultureInfo.InvariantCulture), tns);
                    } 
                } 
                for (int i = 0; i < Imports.Count; i++) {
                    Import import = Imports[i]; 
                    if (import.Namespace.Length > 0) {
                        ns.Add("i" + i.ToString(CultureInfo.InvariantCulture), import.Namespace);
                    }
                } 
            }
            else { 
                ns = Namespaces; 
            }
            serializer.Serialize(writer, this, ns); 
        }

        internal static WsiProfiles GetConformanceClaims(XmlElement documentation) {
            if (documentation == null) 
                return WsiProfiles.None;
 
            WsiProfiles existingClaims = WsiProfiles.None; 

            XmlNode child = documentation.FirstChild; 
            while (child != null) {
                XmlNode sibling = child.NextSibling;
                if (child is XmlElement) {
                    XmlElement element = (XmlElement)child; 
                    if (element.LocalName == Soap.Element.Claim && element.NamespaceURI == Soap.ConformanceClaim) {
                        if (Soap.BasicProfile1_1 == element.GetAttribute(Soap.Attribute.ConformsTo)) { 
                            existingClaims |= WsiProfiles.BasicProfile1_1; 
                        }
                    } 
                }
                child = sibling;
            }
            return existingClaims; 
        }
 
        internal static void AddConformanceClaims(XmlElement documentation, WsiProfiles claims) { 
            //
            claims &= SupportedClaims; 
            if (claims == WsiProfiles.None)
                return;

            // check already presend claims 
            WsiProfiles existingClaims = GetConformanceClaims(documentation);
            claims &= ~existingClaims; 
            if (claims == WsiProfiles.None) 
                return;
 
            XmlDocument d = documentation.OwnerDocument;
            if ((claims & WsiProfiles.BasicProfile1_1) != 0) {
                XmlElement claim = d.CreateElement(Soap.ClaimPrefix, Soap.Element.Claim, Soap.ConformanceClaim);
                claim.SetAttribute(Soap.Attribute.ConformsTo, Soap.BasicProfile1_1); 
                documentation.InsertBefore(claim, null);
            } 
        } 
    }
 

    /// 
    /// 
    ///    [To be supplied.] 
    /// 
    [XmlFormatExtensionPoint("Extensions")] 
    public sealed class Import : DocumentableItem { 
        string ns;
        string location; 
        ServiceDescription parent;
        ServiceDescriptionFormatExtensionCollection extensions;

        internal void SetParent(ServiceDescription parent) { 
            this.parent = parent;
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions { 
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; }
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public ServiceDescription ServiceDescription {
            get { return parent; } 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        [XmlAttribute("namespace")]
        public string Namespace {
            get { return ns == null ? string.Empty : ns; } 
            set { ns = value; }
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        [XmlAttribute("location")]
        public string Location { 
            get { return location == null ? string.Empty : location; }
            set { location = value; } 
        } 
    }
 

    /// 
    /// 
    ///    [To be supplied.] 
    /// 
    public abstract class DocumentableItem { 
        XmlDocument parent; 
        string documentation;
        XmlElement documentationElement; 
        XmlAttribute[] anyAttribute;
        XmlSerializerNamespaces namespaces;

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        [XmlIgnore]
        public string Documentation { 
            get {
                if (documentation != null)
                    return documentation;
                if (documentationElement == null) 
                    return string.Empty;
                return documentationElement.InnerXml; 
            } 
            set {
                documentation = value; 
                StringWriter writer = new StringWriter(CultureInfo.InvariantCulture);
                XmlTextWriter xmlWriter = new XmlTextWriter(writer);
                xmlWriter.WriteElementString(ServiceDescription.Prefix, "documentation", ServiceDescription.Namespace, value);
                Parent.LoadXml(writer.ToString()); 
                documentationElement = parent.DocumentElement;
                xmlWriter.Close(); 
            } 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        [XmlAnyElement("documentation", Namespace=ServiceDescription.Namespace)]
        [ComVisible(false)] 
        public XmlElement DocumentationElement { 
            get { return documentationElement; }
            set { 
                documentationElement = value;
                documentation = null;
            }
        } 

        [XmlAnyAttribute] 
        public System.Xml.XmlAttribute[] ExtensibleAttributes { 
            get {
                return this.anyAttribute; 
            }
            set {
                this.anyAttribute = value;
            } 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        [XmlNamespaceDeclarations]
        public XmlSerializerNamespaces Namespaces {
            get { 
                if (this.namespaces == null)
                    this.namespaces = new XmlSerializerNamespaces(); 
                return this.namespaces; 
            }
            set { this.namespaces = value; } 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        [XmlIgnore] 
        public abstract ServiceDescriptionFormatExtensionCollection Extensions { get; }
 
        internal XmlDocument Parent {
            get {
                if (parent == null)
                    parent = new XmlDocument(); 
                return parent;
            } 
        } 

        internal XmlElement GetDocumentationElement() { 
            if (documentationElement == null) {
                documentationElement = Parent.CreateElement(ServiceDescription.Prefix, "documentation", ServiceDescription.Namespace);
                Parent.InsertBefore(documentationElement, null);
            } 
            return documentationElement;
        } 
    } 

    ///  
    /// 
    ///    [To be supplied.]
    /// 
    public abstract class NamedItem : DocumentableItem { 
        string name;
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        [XmlAttribute("name")]
        public string Name {
            get { return name; } 
            set { name = value; }
        } 
    } 

    ///  
    /// 
    ///    [To be supplied.]
    /// 
    [XmlFormatExtensionPoint("Extensions")] 
    public sealed class Port : NamedItem {
        ServiceDescriptionFormatExtensionCollection extensions; 
        XmlQualifiedName binding = XmlQualifiedName.Empty; 
        Service parent;
 
        internal void SetParent(Service parent) {
            this.parent = parent;
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public Service Service { 
            get { return parent; }
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions { 
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; }
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        [XmlAttribute("binding")]
        public XmlQualifiedName Binding { 
            get { return binding; }
            set { binding = value; }
        }
    } 

    ///  
    ///  
    ///    [To be supplied.]
    ///  
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class Service : NamedItem {
        ServiceDescriptionFormatExtensionCollection extensions;
        PortCollection ports; 
        ServiceDescription parent;
 
        internal void SetParent(ServiceDescription parent) { 
            this.parent = parent;
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public ServiceDescription ServiceDescription { 
            get { return parent; } 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions { 
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; } 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        [XmlElement("port")]
        public PortCollection Ports { 
            get { if (ports == null) ports = new PortCollection(this); return ports; } 
        }
    } 

    /// 
    /// 
    ///    [To be supplied.] 
    /// 
    [XmlFormatExtensionPoint("Extensions")] 
    public sealed class FaultBinding : MessageBinding { 
        ServiceDescriptionFormatExtensionCollection extensions;
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions { 
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; } 
        }
    } 

    /// 
    /// 
    ///    [To be supplied.] 
    /// 
    public abstract class MessageBinding : NamedItem { 
        OperationBinding parent; 

        internal void SetParent(OperationBinding parent) { 
            this.parent = parent;
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public OperationBinding OperationBinding {
            get { return parent; } 
        }
    }

    ///  
    /// 
    ///    [To be supplied.] 
    ///  
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class InputBinding : MessageBinding { 
        ServiceDescriptionFormatExtensionCollection extensions;

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        [XmlIgnore] 
        public override ServiceDescriptionFormatExtensionCollection Extensions {
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; } 
        }
    }

    ///  
    /// 
    ///    [To be supplied.] 
    ///  
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class OutputBinding : MessageBinding { 
        ServiceDescriptionFormatExtensionCollection extensions;

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        [XmlIgnore] 
        public override ServiceDescriptionFormatExtensionCollection Extensions {
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; } 
        }
    }

    ///  
    /// 
    ///    [To be supplied.] 
    ///  
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class OperationBinding : NamedItem { 
        ServiceDescriptionFormatExtensionCollection extensions;
        FaultBindingCollection faults;
        InputBinding input;
        OutputBinding output; 
        Binding parent;
 
        internal void SetParent(Binding parent) { 
            this.parent = parent;
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public Binding Binding { 
            get { return parent; } 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions { 
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; } 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        [XmlElement("input")]
        public InputBinding Input { 
            get { return input; } 
            set {
                if (input != null) { 
                    input.SetParent(null);
                }
                input = value;
                if (input != null) { 
                    input.SetParent(this);
                } 
            } 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        [XmlElement("output")]
        public OutputBinding Output { 
            get { return output; } 
            set {
                if (output != null) { 
                    output.SetParent(null);
                }
                output = value;
                if (output != null) { 
                    output.SetParent(this);
                } 
            } 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        [XmlElement("fault")]
        public FaultBindingCollection Faults { 
            get { if (faults == null) faults = new FaultBindingCollection(this); return faults; } 
        }
    } 

    /// 
    /// 
    ///    [To be supplied.] 
    /// 
    [XmlFormatExtensionPoint("Extensions")] 
    public sealed class Binding : NamedItem { 
        ServiceDescriptionFormatExtensionCollection extensions;
        OperationBindingCollection operations; 
        XmlQualifiedName type = XmlQualifiedName.Empty;
        ServiceDescription parent;

        internal void SetParent(ServiceDescription parent) { 
            this.parent = parent;
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public ServiceDescription ServiceDescription {
            get { return parent; } 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions {
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; } 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        [XmlElement("operation")]
        public OperationBindingCollection Operations {
            get { if (operations == null) operations = new OperationBindingCollection(this); return operations; } 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        [XmlAttribute("type")]
        public XmlQualifiedName Type {
            get { 
                if ((object)type == null) return XmlQualifiedName.Empty;
                return type; 
            } 
            set { type = value; }
        } 
    }

    /// 
    ///  
    ///    [To be supplied.]
    ///  
    public abstract class OperationMessage : NamedItem { 
        XmlQualifiedName message = XmlQualifiedName.Empty;
        Operation parent; 

        internal void SetParent(Operation parent) {
            this.parent = parent;
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public Operation Operation {
            get { return parent; }
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        [XmlAttribute("message")] 
        public XmlQualifiedName Message {
            get { return message; }
            set { message = value; }
        } 
    }
 
    ///  
    /// 
    ///    [To be supplied.] 
    /// 
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class OperationFault : OperationMessage {
        ServiceDescriptionFormatExtensionCollection extensions; 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions {
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; }
        } 
    }
 
    ///  
    /// 
    ///    [To be supplied.] 
    /// 
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class OperationInput : OperationMessage {
        ServiceDescriptionFormatExtensionCollection extensions; 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions {
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; }
        } 
    }
 
    ///  
    /// 
    ///    [To be supplied.] 
    /// 
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class OperationOutput : OperationMessage {
        ServiceDescriptionFormatExtensionCollection extensions; 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions {
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; }
        } 
    }
 
    ///  
    /// 
    ///    [To be supplied.] 
    /// 
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class Operation : NamedItem {
        string[] parameters; 
        OperationMessageCollection messages;
        OperationFaultCollection faults; 
        PortType parent; 
        ServiceDescriptionFormatExtensionCollection extensions;
 
        internal void SetParent(PortType parent) {
            this.parent = parent;
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        [XmlIgnore] 
        public override ServiceDescriptionFormatExtensionCollection Extensions {
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; }
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public PortType PortType { 
            get { return parent; }
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        [XmlAttribute("parameterOrder"), DefaultValue("")]
        public string ParameterOrderString { 
            get {
                if (parameters == null) return string.Empty;
                StringBuilder builder = new StringBuilder();
                for (int i = 0; i < parameters.Length; i++) { 
                    if (i > 0) builder.Append(' ');
                    builder.Append(parameters[i]); 
                } 
                return builder.ToString();
            } 
            set {
                if (value == null)
                    parameters = null;
                else 
                    parameters = value.Split(new char[] {' '});
            } 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        [XmlIgnore] 
        public string[] ParameterOrder {
            get { return parameters; } 
            set { parameters = value; } 
        }
 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        [XmlElement("input", typeof(OperationInput)), 
        XmlElement("output", typeof(OperationOutput))] 
        public OperationMessageCollection Messages {
            get { if (messages == null) messages = new OperationMessageCollection(this); return messages; } 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        [XmlElement("fault")] 
        public OperationFaultCollection Faults {
            get { if (faults == null) faults = new OperationFaultCollection(this); return faults; } 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public bool IsBoundBy(OperationBinding operationBinding) { 
            if (operationBinding.Name != Name) return false;
            OperationMessage input = Messages.Input; 
            if (input != null) {
                if (operationBinding.Input == null) return false;

                string portTypeInputName = GetMessageName(Name, input.Name, true); 
                string bindingInputName = GetMessageName(operationBinding.Name, operationBinding.Input.Name, true);
                if (bindingInputName != portTypeInputName) return false; 
            } 
            else if (operationBinding.Input != null)
                return false; 

            OperationMessage output = Messages.Output;
            if (output != null) {
                if (operationBinding.Output == null) return false; 

                string portTypeOutputName = GetMessageName(Name, output.Name, false); 
                string bindingOutputName = GetMessageName(operationBinding.Name, operationBinding.Output.Name, false); 
                if (bindingOutputName != portTypeOutputName) return false;
            } 
            else if (operationBinding.Output != null)
                return false;
            return true;
        } 

        private string GetMessageName(string operationName, string messageName, bool isInput){ 
            if (messageName != null && messageName.Length > 0) 
                return messageName;
 
            switch (Messages.Flow) {
            case OperationFlow.RequestResponse:
                if (isInput)
                    return operationName + "Request"; 
                return operationName + "Response";
            case OperationFlow.OneWay: 
                if (isInput) 
                    return operationName;
                Debug.Assert(isInput == true, "Oneway flow cannot have an output message"); 
                return null;
                /*Cases not supported
                case OperationFlow.SolicitResponse:
                    if (isInput) 
                        return operationName + "Solicit";
                    return operationName + "Response"; 
                case OperationFlow.Notification: 
                    if (!isInput)
                        return operationName; 
                    Debug.Assert(isInput == false, "Notification flow cannot have an input message");
                    return null;
                 */
            } 
            Debug.Assert(false, "Unknown message flow");
            return null; 
        } 
    }
 
    /// 
    /// 
    ///    [To be supplied.]
    ///  
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class PortType : NamedItem { 
        OperationCollection operations; 
        ServiceDescription parent;
        ServiceDescriptionFormatExtensionCollection extensions; 

        internal void SetParent(ServiceDescription parent) {
            this.parent = parent;
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions {
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; }
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public ServiceDescription ServiceDescription {
            get { return parent; }
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        [XmlElement("operation")] 
        public OperationCollection Operations {
            get { if (operations == null) operations = new OperationCollection(this); return operations; }
        }
    } 

    ///  
    ///  
    ///    [To be supplied.]
    ///  
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class Message : NamedItem {
        MessagePartCollection parts;
        ServiceDescription parent; 
        ServiceDescriptionFormatExtensionCollection extensions;
 
        internal void SetParent(ServiceDescription parent) { 
            this.parent = parent;
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        [XmlIgnore] 
        public override ServiceDescriptionFormatExtensionCollection Extensions { 
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; }
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public ServiceDescription ServiceDescription { 
            get { return parent; } 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        [XmlElement("part")]
        public MessagePartCollection Parts { 
            get { if (parts == null) parts = new MessagePartCollection(this); return parts; } 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public MessagePart[] FindPartsByName(string[] partNames) {
            MessagePart[] partArray = new MessagePart[partNames.Length]; 
            for (int i = 0; i < partNames.Length; i++) { 
                partArray[i] = FindPartByName(partNames[i]);
            } 
            return partArray;
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public MessagePart FindPartByName(string partName) {
            for (int i = 0; i < parts.Count; i++) { 
                MessagePart part = parts[i];
                if (part.Name == partName) return part;
            }
            throw new ArgumentException(Res.GetString(Res.MissingMessagePartForMessageFromNamespace3, partName, Name, ServiceDescription.TargetNamespace), "partName"); 
        }
    } 
 
    /// 
    ///  
    ///    [To be supplied.]
    /// 
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class MessagePart : NamedItem { 
        XmlQualifiedName type = XmlQualifiedName.Empty;
        XmlQualifiedName element = XmlQualifiedName.Empty; 
        Message parent; 
        ServiceDescriptionFormatExtensionCollection extensions;
 
        internal void SetParent(Message parent) {
            this.parent = parent;
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        [XmlIgnore] 
        public override ServiceDescriptionFormatExtensionCollection Extensions {
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; }
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public Message Message { 
            get { return parent; }
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        [XmlAttribute("element")]
        public XmlQualifiedName Element { 
            get { return element; }
            set { element = value; }
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        [XmlAttribute("type")] 
        public XmlQualifiedName Type {
            get {
                if ((object)type == null) return XmlQualifiedName.Empty;
                return type; 
            }
            set { type = value; } 
        } 
    }
 
    /// 
    /// 
    ///    [To be supplied.]
    ///  
    [XmlFormatExtensionPoint("Extensions")]
    public sealed class Types : DocumentableItem { 
        XmlSchemas schemas; 
        ServiceDescriptionFormatExtensionCollection extensions;
 
        internal bool HasItems() {
            return (schemas != null && schemas.Count > 0) ||
                (extensions != null && extensions.Count > 0);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        [XmlIgnore]
        public override ServiceDescriptionFormatExtensionCollection Extensions {
            get { if (extensions == null) extensions = new ServiceDescriptionFormatExtensionCollection(this); return extensions; }
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        [XmlElement("schema", typeof(XmlSchema), Namespace=XmlSchema.Namespace)]
        public XmlSchemas Schemas {
            get { if (schemas == null) schemas = new XmlSchemas(); return schemas; }
        } 
    }
 
    ///  
    /// 
    ///    [To be supplied.] 
    /// 
    public sealed class ServiceDescriptionFormatExtensionCollection : ServiceDescriptionBaseCollection {
        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public ServiceDescriptionFormatExtensionCollection(object parent) : base(parent) { } 

        ArrayList handledElements; 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public object this[int index] { 
            get { return (object)List[index]; } 
            set { List[index] = value; }
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public int Add(object extension) { 
            return List.Add(extension); 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public void Insert(int index, object extension) {
            List.Insert(index, extension); 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public int IndexOf(object extension) { 
            return List.IndexOf(extension);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public bool Contains(object extension) {
            return List.Contains(extension); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public void Remove(object extension) {
            List.Remove(extension);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public void CopyTo(object[] array, int index) {
            List.CopyTo(array, index);
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public object Find(Type type) { 
            for (int i = 0; i < List.Count; i++) {
                object item = List[i];
                if (type.IsAssignableFrom(item.GetType())) {
                    ((ServiceDescriptionFormatExtension)item).Handled = true; 
                    return item;
                } 
            } 
            return null;
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public object[] FindAll(Type type) { 
            ArrayList list = new ArrayList(); 
            for (int i = 0; i < List.Count; i++) {
                object item = List[i]; 
                if (type.IsAssignableFrom(item.GetType())) {
                    ((ServiceDescriptionFormatExtension)item).Handled = true;
                    list.Add(item);
                } 
            }
            return (object[])list.ToArray(type); 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public XmlElement Find(string name, string ns) { 
            for (int i = 0; i < List.Count; i++) {
                XmlElement element = List[i] as XmlElement; 
                if (element != null && element.LocalName == name && element.NamespaceURI == ns) { 
                    SetHandled(element);
                    return element; 
                }
            }
            return null;
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public XmlElement[] FindAll(string name, string ns) {
            ArrayList list = new ArrayList();
            for (int i = 0; i < List.Count; i++) {
                XmlElement element = List[i] as XmlElement; 
                if (element != null && element.LocalName == name && element.NamespaceURI == ns) {
                    SetHandled(element); 
                    list.Add(element); 
                }
            } 
            return (XmlElement[])list.ToArray(typeof(XmlElement));
        }

        void SetHandled(XmlElement element) { 
            if (handledElements == null)
                handledElements = new ArrayList(); 
            if (!handledElements.Contains(element)) 
                handledElements.Add(element);
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public bool IsHandled(object item) { 
            if (item is XmlElement) 
                return IsHandled((XmlElement)item);
            else 
                return ((ServiceDescriptionFormatExtension)item).Handled;
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public bool IsRequired(object item) {
            if (item is XmlElement) 
                return IsRequired((XmlElement)item);
            else
                return ((ServiceDescriptionFormatExtension)item).Required;
        } 

        bool IsHandled(XmlElement element) { 
            if (handledElements == null) return false; 
            return handledElements.Contains(element);
        } 

        bool IsRequired(XmlElement element) {
            XmlAttribute requiredAttr = element.Attributes["required", ServiceDescription.Namespace];
            if (requiredAttr == null || requiredAttr.Value == null) { 
                requiredAttr = element.Attributes["required"];
                if (requiredAttr == null || requiredAttr.Value == null) return false; // not required, by default 
            } 
            return XmlConvert.ToBoolean(requiredAttr.Value);
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        protected override void SetParent(object value, object parent) { 
            if (value is ServiceDescriptionFormatExtension) ((ServiceDescriptionFormatExtension)value).SetParent(parent); 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        protected override void OnValidate(object value) {
            if (!(value is XmlElement || value is ServiceDescriptionFormatExtension)) 
                throw new ArgumentException(Res.GetString(Res.OnlyXmlElementsOrTypesDerivingFromServiceDescriptionFormatExtension0), "value"); 
            base.OnValidate(value);
        } 
    }

    /// 
    ///  
    ///    [To be supplied.]
    ///  
    public abstract class ServiceDescriptionFormatExtension { 
        object parent;
        bool required; 
        bool handled;

        internal void SetParent(object parent) {
            this.parent = parent; 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public object Parent {
            get { return parent; }
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        [XmlAttribute("required", Namespace=ServiceDescription.Namespace), DefaultValue(false)]
        public bool Required {
            get { return required; }
            set { required = value; } 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        [XmlIgnore]
        public bool Handled {
            get { return handled; } 
            set { handled = value; }
        } 
    } 

    ///  
    /// 
    ///    [To be supplied.]
    /// 
    public enum OperationFlow { 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        None, 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        OneWay,
        ///  
        ///  
        ///    [To be supplied.]
        ///  
        Notification,
        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        RequestResponse, 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        SolicitResponse,
    }
 
    /// 
    ///  
    ///    [To be supplied.] 
    /// 
    public sealed class OperationMessageCollection : ServiceDescriptionBaseCollection { 
        internal OperationMessageCollection(Operation operation) : base(operation) { }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public OperationMessage this[int index] { 
            get { return (OperationMessage)List[index]; }
            set { List[index] = value; } 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public int Add(OperationMessage operationMessage) { 
            return List.Add(operationMessage);
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public void Insert(int index, OperationMessage operationMessage) { 
            List.Insert(index, operationMessage); 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public int IndexOf(OperationMessage operationMessage) {
            return List.IndexOf(operationMessage); 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public bool Contains(OperationMessage operationMessage) { 
            return List.Contains(operationMessage);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public void Remove(OperationMessage operationMessage) {
            List.Remove(operationMessage); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public void CopyTo(OperationMessage[] array, int index) {
            List.CopyTo(array, index);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public OperationInput Input {
            get {
                for (int i = 0; i < List.Count; i++) {
                    OperationInput input = List[i] as OperationInput; 
                    if (input != null) {
                        return input; 
                    } 
                }
                return null; 
            }
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public OperationOutput Output {
            get { 
                for (int i = 0; i < List.Count; i++) {
                    OperationOutput output = List[i] as OperationOutput;
                    if (output != null) {
                        return output; 
                    }
                } 
                return null; 
            }
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public OperationFlow Flow { 
            get { 
                if (List.Count == 0) {
                    return OperationFlow.None; 
                }
                else if (List.Count == 1) {
                    if (List[0] is OperationInput) {
                        return OperationFlow.OneWay; 
                    }
                    else { 
                        return OperationFlow.Notification; 
                    }
                } 
                else {
                    if (List[0] is OperationInput) {
                        return OperationFlow.RequestResponse;
                    } 
                    else {
                        return OperationFlow.SolicitResponse; 
                    } 
                }
            } 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        protected override void SetParent(object value, object parent) { 
            ((OperationMessage)value).SetParent((Operation)parent);
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        protected override void OnInsert(int index, object value) { 
            if (Count > 1 || (Count == 1 && value.GetType() == List[0].GetType())) 
                throw new InvalidOperationException(Res.GetString(Res.WebDescriptionTooManyMessages));
 
            base.OnInsert(index, value);
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        protected override void OnSet(int index, object oldValue, object newValue) {
            if (oldValue.GetType() != newValue.GetType()) throw new InvalidOperationException(Res.GetString(Res.WebDescriptionTooManyMessages)); 
            base.OnSet(index, oldValue, newValue);
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        protected override void OnValidate(object value) {
            if (!(value is OperationInput || value is OperationOutput)) 
                throw new ArgumentException(Res.GetString(Res.OnlyOperationInputOrOperationOutputTypes), "value");
            base.OnValidate(value);
        }
    } 

    ///  
    ///  
    ///    [To be supplied.]
    ///  
    public sealed class ImportCollection : ServiceDescriptionBaseCollection {
        internal ImportCollection(ServiceDescription serviceDescription) : base(serviceDescription) { }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public Import this[int index] {
            get { return (Import)List[index]; } 
            set { List[index] = value; }
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public int Add(Import import) {
            return List.Add(import); 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public void Insert(int index, Import import) { 
            List.Insert(index, import);
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public int IndexOf(Import import) { 
            return List.IndexOf(import); 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public bool Contains(Import import) {
            return List.Contains(import); 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public void Remove(Import import) { 
            List.Remove(import);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public void CopyTo(Import[] array, int index) {
            List.CopyTo(array, index); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        protected override void SetParent(object value, object parent) {
            ((Import)value).SetParent((ServiceDescription)parent);
        } 
    }
 
    ///  
    /// 
    ///    [To be supplied.] 
    /// 
    public sealed class MessageCollection : ServiceDescriptionBaseCollection {
        internal MessageCollection(ServiceDescription serviceDescription) : base(serviceDescription) { }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public Message this[int index] { 
            get { return (Message)List[index]; }
            set { List[index] = value; }
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public int Add(Message message) { 
            return List.Add(message);
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public void Insert(int index, Message message) {
            List.Insert(index, message); 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public int IndexOf(Message message) { 
            return List.IndexOf(message);
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public bool Contains(Message message) { 
            return List.Contains(message); 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public void Remove(Message message) {
            List.Remove(message); 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public void CopyTo(Message[] array, int index) { 
            List.CopyTo(array, index);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public Message this[string name] {
            get { return (Message)Table[name]; } 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        protected override string GetKey(object value) {
            return ((Message)value).Name;
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        protected override void SetParent(object value, object parent) {
            ((Message)value).SetParent((ServiceDescription)parent);
        }
    } 

    ///  
    ///  
    ///    [To be supplied.]
    ///  
    public sealed class PortCollection : ServiceDescriptionBaseCollection {
        internal PortCollection(Service service) : base(service) { }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public Port this[int index] {
            get { return (Port)List[index]; } 
            set { List[index] = value; }
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public int Add(Port port) {
            return List.Add(port); 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public void Insert(int index, Port port) { 
            List.Insert(index, port);
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public int IndexOf(Port port) { 
            return List.IndexOf(port); 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public bool Contains(Port port) {
            return List.Contains(port); 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public void Remove(Port port) { 
            List.Remove(port);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public void CopyTo(Port[] array, int index) {
            List.CopyTo(array, index); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public Port this[string name] {
            get { return (Port)Table[name]; }
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        protected override string GetKey(object value) {
            return ((Port)value).Name;
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        protected override void SetParent(object value, object parent) { 
            ((Port)value).SetParent((Service)parent);
        }
    }
 
    /// 
    ///  
    ///    [To be supplied.] 
    /// 
    public sealed class PortTypeCollection : ServiceDescriptionBaseCollection { 
        internal PortTypeCollection(ServiceDescription serviceDescription) : base(serviceDescription) { }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public PortType this[int index] { 
            get { return (PortType)List[index]; }
            set { List[index] = value; } 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public int Add(PortType portType) { 
            return List.Add(portType);
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public void Insert(int index, PortType portType) { 
            List.Insert(index, portType); 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public int IndexOf(PortType portType) {
            return List.IndexOf(portType); 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public bool Contains(PortType portType) { 
            return List.Contains(portType);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public void Remove(PortType portType) {
            List.Remove(portType); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public void CopyTo(PortType[] array, int index) {
            List.CopyTo(array, index);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public PortType this[string name] {
            get { return (PortType)Table[name]; }
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        protected override string GetKey(object value) { 
            return ((PortType)value).Name;
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        protected override void SetParent(object value, object parent) {
            ((PortType)value).SetParent((ServiceDescription)parent); 
        }
    }

    ///  
    /// 
    ///    [To be supplied.] 
    ///  
    public sealed class BindingCollection : ServiceDescriptionBaseCollection {
        internal BindingCollection(ServiceDescription serviceDescription) : base(serviceDescription) { } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public Binding this[int index] { 
            get { return (Binding)List[index]; } 
            set { List[index] = value; }
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        public int Add(Binding binding) { 
            return List.Add(binding); 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public void Insert(int index, Binding binding) {
            List.Insert(index, binding); 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public int IndexOf(Binding binding) { 
            return List.IndexOf(binding);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public bool Contains(Binding binding) {
            return List.Contains(binding); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public void Remove(Binding binding) {
            List.Remove(binding);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public void CopyTo(Binding[] array, int index) {
            List.CopyTo(array, index);
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public Binding this[string name] { 
            get { return (Binding)Table[name]; }
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        protected override string GetKey(object value) {
            return ((Binding)value).Name; 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        protected override void SetParent(object value, object parent) { 
            ((Binding)value).SetParent((ServiceDescription)parent);
        } 
    }

    /// 
    ///  
    ///    [To be supplied.]
    ///  
    public sealed class ServiceCollection : ServiceDescriptionBaseCollection { 
        internal ServiceCollection(ServiceDescription serviceDescription) : base(serviceDescription) { }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public Service this[int index] {
            get { return (Service)List[index]; } 
            set { List[index] = value; } 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        public int Add(Service service) {
            return List.Add(service); 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public void Insert(int index, Service service) { 
            List.Insert(index, service);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public int IndexOf(Service service) {
            return List.IndexOf(service); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public bool Contains(Service service) {
            return List.Contains(service);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public void Remove(Service service) {
            List.Remove(service);
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public void CopyTo(Service[] array, int index) { 
            List.CopyTo(array, index);
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public Service this[string name] {
            get { return (Service)Table[name]; } 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        protected override string GetKey(object value) { 
            return ((Service)value).Name;
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        protected override void SetParent(object value, object parent) { 
            ((Service)value).SetParent((ServiceDescription)parent); 
        }
    } 

    /// 
    /// 
    ///    [To be supplied.] 
    /// 
    public sealed class MessagePartCollection : ServiceDescriptionBaseCollection { 
        internal MessagePartCollection(Message message) : base(message) { } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public MessagePart this[int index] { 
            get { return (MessagePart)List[index]; }
            set { List[index] = value; } 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public int Add(MessagePart messagePart) { 
            return List.Add(messagePart);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public void Insert(int index, MessagePart messagePart) {
            List.Insert(index, messagePart); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public int IndexOf(MessagePart messagePart) {
            return List.IndexOf(messagePart);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public bool Contains(MessagePart messagePart) {
            return List.Contains(messagePart);
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public void Remove(MessagePart messagePart) { 
            List.Remove(messagePart);
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public void CopyTo(MessagePart[] array, int index) {
            List.CopyTo(array, index); 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public MessagePart this[string name] { 
            get { return (MessagePart)Table[name]; }
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        protected override string GetKey(object value) { 
            return ((MessagePart)value).Name; 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        protected override void SetParent(object value, object parent) {
            ((MessagePart)value).SetParent((Message)parent); 
        } 
    }
 
    /// 
    /// 
    ///    [To be supplied.]
    ///  
    public sealed class OperationBindingCollection : ServiceDescriptionBaseCollection {
        internal OperationBindingCollection(Binding binding) : base(binding) { } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public OperationBinding this[int index] {
            get { return (OperationBinding)List[index]; } 
            set { List[index] = value; }
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public int Add(OperationBinding bindingOperation) {
            return List.Add(bindingOperation); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public void Insert(int index, OperationBinding bindingOperation) {
            List.Insert(index, bindingOperation);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public int IndexOf(OperationBinding bindingOperation) {
            return List.IndexOf(bindingOperation);
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public bool Contains(OperationBinding bindingOperation) { 
            return List.Contains(bindingOperation);
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public void Remove(OperationBinding bindingOperation) {
            List.Remove(bindingOperation); 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public void CopyTo(OperationBinding[] array, int index) { 
            List.CopyTo(array, index);
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        protected override void SetParent(object value, object parent) { 
            ((OperationBinding)value).SetParent((Binding)parent); 
        }
    } 

    /// 
    /// 
    ///    [To be supplied.] 
    /// 
    public sealed class FaultBindingCollection : ServiceDescriptionBaseCollection { 
        internal FaultBindingCollection(OperationBinding operationBinding) : base(operationBinding) { } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public FaultBinding this[int index] { 
            get { return (FaultBinding)List[index]; }
            set { List[index] = value; } 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public int Add(FaultBinding bindingOperationFault) { 
            return List.Add(bindingOperationFault);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public void Insert(int index, FaultBinding bindingOperationFault) {
            List.Insert(index, bindingOperationFault); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public int IndexOf(FaultBinding bindingOperationFault) {
            return List.IndexOf(bindingOperationFault);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public bool Contains(FaultBinding bindingOperationFault) {
            return List.Contains(bindingOperationFault);
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public void Remove(FaultBinding bindingOperationFault) { 
            List.Remove(bindingOperationFault);
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public void CopyTo(FaultBinding[] array, int index) {
            List.CopyTo(array, index); 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public FaultBinding this[string name] { 
            get { return (FaultBinding)Table[name]; }
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        protected override string GetKey(object value) { 
            return ((FaultBinding)value).Name; 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        protected override void SetParent(object value, object parent) {
            ((FaultBinding)value).SetParent((OperationBinding)parent); 
        } 
    }
 
    /// 
    /// 
    ///    [To be supplied.]
    ///  
    public sealed class OperationCollection : ServiceDescriptionBaseCollection {
        internal OperationCollection(PortType portType) : base(portType) { } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public Operation this[int index] {
            get { return (Operation)List[index]; } 
            set { List[index] = value; }
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public int Add(Operation operation) {
            return List.Add(operation); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public void Insert(int index, Operation operation) {
            List.Insert(index, operation);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public int IndexOf(Operation operation) {
            return List.IndexOf(operation);
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public bool Contains(Operation operation) { 
            return List.Contains(operation);
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public void Remove(Operation operation) {
            List.Remove(operation); 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public void CopyTo(Operation[] array, int index) { 
            List.CopyTo(array, index);
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        protected override void SetParent(object value, object parent) { 
            ((Operation)value).SetParent((PortType)parent); 
        }
    } 

    /// 
    /// 
    ///    [To be supplied.] 
    /// 
    public sealed class OperationFaultCollection : ServiceDescriptionBaseCollection { 
        internal OperationFaultCollection(Operation operation) : base(operation) { } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public OperationFault this[int index] { 
            get { return (OperationFault)List[index]; }
            set { List[index] = value; } 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        public int Add(OperationFault operationFaultMessage) { 
            return List.Add(operationFaultMessage);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        public void Insert(int index, OperationFault operationFaultMessage) {
            List.Insert(index, operationFaultMessage); 
        }
 
        ///  
        /// 
        ///    [To be supplied.] 
        /// 
        public int IndexOf(OperationFault operationFaultMessage) {
            return List.IndexOf(operationFaultMessage);
        } 

        ///  
        ///  
        ///    [To be supplied.]
        ///  
        public bool Contains(OperationFault operationFaultMessage) {
            return List.Contains(operationFaultMessage);
        }
 
        /// 
        ///  
        ///    [To be supplied.] 
        /// 
        public void Remove(OperationFault operationFaultMessage) { 
            List.Remove(operationFaultMessage);
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        public void CopyTo(OperationFault[] array, int index) {
            List.CopyTo(array, index); 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        public OperationFault this[string name] { 
            get { return (OperationFault)Table[name]; }
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        protected override string GetKey(object value) { 
            return ((OperationFault)value).Name; 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        protected override void SetParent(object value, object parent) {
            ((OperationFault)value).SetParent((Operation)parent); 
        } 
    }
 
    /// 
    /// 
    ///    [To be supplied.]
    ///  
    public abstract class ServiceDescriptionBaseCollection : CollectionBase {
        Hashtable table; // 
        object parent; 

        internal ServiceDescriptionBaseCollection(object parent) { 
            this.parent = parent;
        }

        ///  
        /// 
        ///    [To be supplied.] 
        ///  
        protected virtual IDictionary Table {
            get { if (table == null) table = new Hashtable(); return table; } 
        }

        /// 
        ///  
        ///    [To be supplied.]
        ///  
        protected virtual string GetKey(object value) { 
            return null; // returning null means there is no key
        } 

        /// 
        /// 
        ///    [To be supplied.] 
        /// 
        protected virtual void SetParent(object value, object parent) { 
            // default is that the item has no parent 
        }
 
        /// 
        /// 
        ///    [To be supplied.]
        ///  
        protected override void OnInsertComplete(int index, object value) {
            AddValue(value); 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        protected override void OnRemove(int index, object value) { 
            RemoveValue(value);
        } 
 
        /// 
        ///  
        ///    [To be supplied.]
        /// 
        protected override void OnClear() {
            for (int i = 0; i < List.Count; i++) { 
                RemoveValue(List[i]);
            } 
        } 

        ///  
        /// 
        ///    [To be supplied.]
        /// 
        protected override void OnSet(int index, object oldValue, object newValue) { 
            RemoveValue(oldValue);
            AddValue(newValue); 
        } 

        void AddValue(object value) { 
            string key = GetKey(value);
            if (key != null) {
                try {
                    Table.Add(key, value); 
                }
                catch (Exception e) { 
                    if (e is ThreadAbortException || e is StackOverflowException || e is OutOfMemoryException) { 
                        throw;
                    } 
                    if (Table[key] != null) {
                        throw new ArgumentException(GetDuplicateMessage(value.GetType(), key), e.InnerException);
                    }
                    else { 
                        throw e;
                    } 
                } 
            }
            SetParent(value, parent); 
        }

        void RemoveValue(object value) {
            string key = GetKey(value); 
            if (key != null) Table.Remove(key);
            SetParent(value, null); 
        } 

        static string GetDuplicateMessage(Type type, string elemName) { 
            string message = null;
            if (type == typeof(ServiceDescriptionFormatExtension))
                message = Res.GetString(Res.WebDuplicateFormatExtension, elemName);
            else if (type == typeof(OperationMessage)) 
                message = Res.GetString(Res.WebDuplicateOperationMessage, elemName);
            else if (type == typeof(Import)) 
                message = Res.GetString(Res.WebDuplicateImport, elemName); 
            else if (type == typeof(Message))
                message = Res.GetString(Res.WebDuplicateMessage, elemName); 
            else if (type == typeof(Port))
                message = Res.GetString(Res.WebDuplicatePort, elemName);
            else if (type == typeof(PortType))
                message = Res.GetString(Res.WebDuplicatePortType, elemName); 
            else if (type == typeof(Binding))
                message = Res.GetString(Res.WebDuplicateBinding, elemName); 
            else if (type == typeof(Service)) 
                message = Res.GetString(Res.WebDuplicateService, elemName);
            else if (type == typeof(MessagePart)) 
                message = Res.GetString(Res.WebDuplicateMessagePart, elemName);
            else if (type == typeof(OperationBinding))
                message = Res.GetString(Res.WebDuplicateOperationBinding, elemName);
            else if (type == typeof(FaultBinding)) 
                message = Res.GetString(Res.WebDuplicateFaultBinding, elemName);
            else if (type == typeof(Operation)) 
                message = Res.GetString(Res.WebDuplicateOperation, elemName); 
            else if (type == typeof(OperationFault))
                message = Res.GetString(Res.WebDuplicateOperationFault, elemName); 
            else
                message = Res.GetString(Res.WebDuplicateUnknownElement, type, elemName);

            return message; 
        }
    } 
 
    internal class Schemas {
        Schemas() {} 
        internal const string Wsdl = @"

 
   
    
       
    
  

   
    
       
      This type is extended by  component types to allow them to be documented 
      
     
    
      
    
   
 
  
     
      
         
          
          This type is extended by component types to allow attributes from other namespaces to be added.
          
         
        
           
         
        
       
    
  
  
     
      
         
           
          This type is extended by component types to allow elements from other namespaces to be added.
           
        
        
          
         
        
       
     
  
  
  
    
       
      
     
     
      
       
    
    
      
       
    
     
       
      
     
    
      
      
     
  
 
   
    
       
      Any top level optional element allowed to appear more then once - any child of definitions element except wsdl:types. Any extensibility element is allowed in any place.
      
    
     
      
       
       
        
           
          
        
      
       
      
       
         
          
           
        
	  
    
   

   
     
      
         
          
        
        
         
      
     
   

   
    
      
        
         
      
     
   

   
    
      
    
   

   
     
      
         
          
        
        
       
    
   
 
  
     
      
        
        
         
      
     
   

   
    
      
        
           
        
         
       
    
   

  
    
       
	    
           
             
            
           
        
        
        
       
    
   
 
  
     
      
 	  
	    
 		 
      
     
   

   
    
      
 	  
	     
 		
	   
     
  
 
  
    
      
         
        
       
     
  
 
  
    
      
         
        
       
     
  
 
  
    
      
         
          
         
         
        
       
    
  

   
    
       
         
      
     
  

  
     
      
         
       
    
   

  
    
       
        
           
           
          
         
        
      
    
   

   
     
      
         
          
        
        
       
    
   
 
  
     
      
        
        
       
    
   
 
  
   
  
    
  
 
";
 
        internal const string Soap = @" 

   
  
    
      
      'encodingStyle' indicates any canonicalization conventions followed in the contents of the containing element.  For example, the value 'http://schemas.xmlsoap.org/soap/encoding/' indicates the pattern described in SOAP specification 
      
     
     
  
   
  
    
      
         
        
       
     
  
   
    
      
      
     
  
   
   
    
       
        
        
      
     
  
   
   
    
     
    
  
  
     
      
         
         
      
     
  
  
    
       
      
     
   
  
   
    
      
        
         
        
       
     
  
   
    
      
        
       
    
   
   
  
     
    
    
    
     
  
   
     
      
         
          
        
        
       
    
   
   
  
     
  
  
  
     
      
         
       
    
   
";

        internal const string WebRef = @"
 
  
     
       
        
           
          
          
          
           
        
       
     
  
   
    
      
      
       
    
   
   
    
       
      
      
      
         
          
             
           
        
       
    
  
  
   
    
       
       
      
       
      
      
      
       
      
       
       
      
       
      
      
      
       
      
         
           
            
           
        
      
    
   
  
"; 
 
        internal const string SoapEncoding = @"


  
   
      
	    
	 
    
 

  
     
    
     
   

   
    
  

   
  
 
   
    
     
  

  
 
  
     
   

   
    
      
 	
   

   
   
    
     
    
  
  
   
    
       
	 
  
 
  
    
    
   

   
     
  
 
  
  
    
       
        
       
     
  
 
  
  
    
       
        
       
     
  
 


  
   
    
       
         
      
     
  


   
  
     
       
        
       
    
  

   
  
     
       
        
       
    
  

   
  
     
       
        
       
    
  

   
  
     
       
        
       
    
  

   
  
     
       
        
       
    
  

   
  
     
       
        
       
    
  

   
  
     
       
        
       
    
  

   
  
     
       
        
       
    
  

   
  
     
       
        
       
    
  

   
  
     
      
       
      
    
  

   
  
     
       
        
       
    
  

   
  
     
       
        
       
    
  

   
  
     
       
        
       
    
  

   
  
     
       
        
       
    
  

 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
   
     
      
         
      
    
  
 
  
"; 
    } 
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.

                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK