Exemple #1
1
		public Binding ()
		{
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
			operations = new OperationBindingCollection (this);
			serviceDescription = null;
			type = XmlQualifiedName.Empty;
		}
Exemple #2
0
		public Import ()
		{
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
			location = String.Empty;
			ns = String.Empty;
			serviceDescription = null;
		}
		public void Add ()
		{
			ServiceDescriptionFormatExtensionCollection c =
				new ServiceDescriptionFormatExtensionCollection (new ServiceDescription ());

			c.Add (0);
		}
		public void Add2 ()
		{
			ServiceDescriptionFormatExtensionCollection c =
				new ServiceDescriptionFormatExtensionCollection (new ServiceDescription ());

			c.Add (new XmlDocument ().CreateElement ("foo"));
		}
        internal static void ReadExtension(XmlDocument doc, XmlReader reader, object ob)
        {
            ServiceDescriptionFormatExtensionCollection extensions = ExtensionManager.GetExtensionPoint(ob);

            if (extensions != null)
            {
                ExtensionInfo info = ExtensionManager.GetFormatExtensionInfo(reader.LocalName, reader.NamespaceURI);
                if (info != null)
                {
                    object extension = info.Serializer.Deserialize(reader);
                    extensions.Add((ServiceDescriptionFormatExtension)extension);
                    return;
                }
            }

            //No XmlFormatExtensionPoint attribute found

#if NET_2_0
            //Add to DocumentableItem.Extensions property
            DocumentableItem item = ob as DocumentableItem;
            if (item == null)
            {
                reader.Skip();
                return;
            }

            item.Extensions.Add(doc.ReadNode(reader));
#else
            reader.Skip();
#endif
        }
Exemple #6
0
		public OperationBinding ()
		{
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
			faults = new FaultBindingCollection (this);
			input = null;
			output = null;
		}
		public void Find ()
		{
			ServiceDescriptionFormatExtensionCollection c =
				new ServiceDescriptionFormatExtensionCollection (new ServiceDescription ());
			c.Add (new MySoapBinding ());
			Assert.IsNotNull (c.Find (typeof (SoapBinding)));
		}
Exemple #8
0
 public Binding()
 {
     extensions         = new ServiceDescriptionFormatExtensionCollection(this);
     operations         = new OperationBindingCollection(this);
     serviceDescription = null;
     type = XmlQualifiedName.Empty;
 }
Exemple #9
0
		public MessagePart ()
		{
			element = XmlQualifiedName.Empty;
			message = null;
			type = XmlQualifiedName.Empty;
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
		}
Exemple #10
0
 public OperationBinding()
 {
     extensions = new ServiceDescriptionFormatExtensionCollection(this);
     faults     = new FaultBindingCollection(this);
     input      = null;
     output     = null;
 }
Exemple #11
0
 public Import()
 {
     extensions         = new ServiceDescriptionFormatExtensionCollection(this);
     location           = String.Empty;
     ns                 = String.Empty;
     serviceDescription = null;
 }
            // [....], this could be simplified if we used generics.
            internal static void ConvertExtensions(WsdlNS.ServiceDescriptionFormatExtensionCollection extensions, EnvelopeVersion version, ConvertExtension conversionMethod)
            {
                bool foundOne = false;

                for (int i = extensions.Count - 1; i >= 0; i--)
                {
                    object o = extensions[i];
                    if (conversionMethod(ref o, version))
                    {
                        if (o == null)
                        {
                            extensions.Remove(extensions[i]);
                        }
                        else
                        {
                            extensions[i] = o;
                        }
                        foundOne = true;
                    }
                }

                if (!foundOne)
                {
                    object o = null;
                    conversionMethod(ref o, version);
                    if (o != null)
                    {
                        extensions.Add(o);
                    }
                }
            }
Exemple #13
0
 public MessagePart()
 {
     element    = XmlQualifiedName.Empty;
     message    = null;
     type       = XmlQualifiedName.Empty;
     extensions = new ServiceDescriptionFormatExtensionCollection(this);
 }
Exemple #14
0
        public PortType()
        {
            operations         = new OperationCollection(this);
            serviceDescription = null;
#if NET_2_0
            extensions = new ServiceDescriptionFormatExtensionCollection(this);
#endif
        }
Exemple #15
0
 public Operation()
 {
     faults         = new OperationFaultCollection(this);
     messages       = new OperationMessageCollection(this);
     parameterOrder = null;
     portType       = null;
     extensions     = new ServiceDescriptionFormatExtensionCollection(this);
 }
Exemple #16
0
		public PortType ()
		{
			operations = new OperationCollection (this);
			serviceDescription = null;
#if NET_2_0
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
#endif
		}
Exemple #17
0
		public Operation ()
		{
			faults = new OperationFaultCollection (this);
			messages = new OperationMessageCollection (this);
			parameterOrder = null;
			portType = null;
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
		}
Exemple #18
0
        public Service()
        {
            extensions = new ServiceDescriptionFormatExtensionCollection(this);
#if !NET_2_0
            name = String.Empty;
#endif
            ports = new PortCollection(this);
            serviceDescription = null;
        }
		public Service ()
		{
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
#if !NET_2_0
			name = String.Empty;
#endif
			ports = new PortCollection (this);
			serviceDescription = null;
		}
Exemple #20
0
		public Port ()
		{
			binding = null;
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
#if !NET_2_0
			name = String.Empty;
#endif
			service = null;
		}
Exemple #21
0
        public Port()
        {
            binding    = null;
            extensions = new ServiceDescriptionFormatExtensionCollection(this);
#if !NET_2_0
            name = String.Empty;
#endif
            service = null;
        }
Exemple #22
0
        public Binding()
        {
            extensions = new ServiceDescriptionFormatExtensionCollection(this);
#if !NET_2_0
            name = String.Empty;
#endif
            operations         = new OperationBindingCollection(this);
            serviceDescription = null;
            type = XmlQualifiedName.Empty;
        }
		public OperationBinding ()
		{
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
			faults = new FaultBindingCollection (this);
			input = null;
#if !NET_2_0
			name = String.Empty;
#endif
			output = null;
		}
Exemple #24
0
        public OperationBinding()
        {
            extensions = new ServiceDescriptionFormatExtensionCollection(this);
            faults     = new FaultBindingCollection(this);
            input      = null;
#if !NET_2_0
            name = String.Empty;
#endif
            output = null;
        }
Exemple #25
0
		public Binding ()
		{
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
#if !NET_2_0
			name = String.Empty;
#endif
			operations = new OperationBindingCollection (this);
			serviceDescription = null;
			type = XmlQualifiedName.Empty;
		}
Exemple #26
0
        public Message()
        {
#if !NET_2_0
            name = String.Empty;
#endif
#if NET_2_0
            extensions = new ServiceDescriptionFormatExtensionCollection(this);
#endif
            parts = new MessagePartCollection(this);
            serviceDescription = null;
        }
Exemple #27
0
		public Message ()
		{
#if !NET_2_0
			name = String.Empty;
#endif
#if NET_2_0
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
#endif
			parts = new MessagePartCollection (this);
			serviceDescription = null;
		}
Exemple #28
0
 void AddExtensionNamespaces(XmlSerializerNamespaces ns, ServiceDescriptionFormatExtensionCollection extensions)
 {
     foreach (ServiceDescriptionFormatExtension ext in extensions)
     {
         ExtensionInfo einf = ExtensionManager.GetFormatExtensionInfo(ext.GetType());
         foreach (XmlQualifiedName qname in einf.NamespaceDeclarations)
         {
             ns.Add(qname.Name, qname.Namespace);
         }
     }
 }
Exemple #29
0
 private static bool CheckExtensions(ServiceDescriptionFormatExtensionCollection extensions)
 {
     foreach (ServiceDescriptionFormatExtension extension in extensions)
     {
         if (extension.Required)
         {
             return(false);
         }
     }
     return(true);
 }
Exemple #30
0
        public MessagePart()
        {
            element = XmlQualifiedName.Empty;
            message = null;
#if !NET_2_0
            name = String.Empty;
#endif
            type = XmlQualifiedName.Empty;
#if NET_2_0
            extensions = new ServiceDescriptionFormatExtensionCollection(this);
#endif
        }
Exemple #31
0
		public MessagePart ()
		{
			element = XmlQualifiedName.Empty;
			message = null;
#if !NET_2_0
			name = String.Empty;
#endif
			type = XmlQualifiedName.Empty;
#if NET_2_0
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
#endif
		}
Exemple #32
0
        internal static void WriteExtensions(XmlWriter writer, object ob)
        {
            ServiceDescriptionFormatExtensionCollection extensions = ExtensionManager.GetExtensionPoint(ob);

            if (extensions != null)
            {
                foreach (ServiceDescriptionFormatExtension ext in extensions)
                {
                    WriteExtension(writer, ext);
                }
            }
        }
        private static void RemovePolicyFormatFromExtensions(ServiceDescriptionFormatExtensionCollection extensions)
        {
            var toRemove = new List<XmlElement>();

            extensions.OfType<XmlElement>()
                      .Where(element => element.Name.EndsWith(":Policy") ||
                             element.Name.EndsWith(":PolicyReference"))
                      .ToList()
                      .ForEach(toRemove.Add);

            toRemove.ForEach(extensions.Remove);
        }
Exemple #34
0
        public Operation()
        {
            faults   = new OperationFaultCollection(this);
            messages = new OperationMessageCollection(this);
#if !NET_2_0
            name = String.Empty;
#endif
            parameterOrder = null;
            portType       = null;
#if NET_2_0
            extensions = new ServiceDescriptionFormatExtensionCollection(this);
#endif
        }
Exemple #35
0
		public Operation ()
		{
			faults = new OperationFaultCollection (this);
			messages = new OperationMessageCollection (this);
#if !NET_2_0
			name = String.Empty;
#endif
			parameterOrder = null;
			portType = null;
#if NET_2_0
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
#endif
		}
Exemple #36
0
		public ServiceDescription ()
		{
			bindings = new BindingCollection (this);
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
			imports = new ImportCollection (this);
			messages = new MessageCollection (this);
			portTypes = new PortTypeCollection (this);

			serviceDescriptions = null;
			services = new ServiceCollection (this);
			targetNamespace = null;
			types = new Types ();
		}
Exemple #37
0
        public ServiceDescription()
        {
            bindings   = new BindingCollection(this);
            extensions = new ServiceDescriptionFormatExtensionCollection(this);
            imports    = new ImportCollection(this);
            messages   = new MessageCollection(this);
            portTypes  = new PortTypeCollection(this);

            serviceDescriptions = null;
            services            = new ServiceCollection(this);
            targetNamespace     = null;
            types = new Types();
        }
Exemple #38
0
        private static IEnumerable <XmlElement> FindAllElements(WsdlNS.ServiceDescriptionFormatExtensionCollection extensions, string elementName)
        {
            List <XmlElement> policyReferences = new List <XmlElement>();

            for (int i = 0; i < extensions.Count; i++)
            {
                XmlElement element = extensions[i] as XmlElement;
                if (element != null && element.LocalName == elementName)
                {
                    policyReferences.Add(element);
                }
            }

            return(policyReferences);
        }
        public ServiceDescription()
        {
            bindings   = new BindingCollection(this);
            extensions = new ServiceDescriptionFormatExtensionCollection(this);
            imports    = new ImportCollection(this);
            messages   = new MessageCollection(this);
#if !NET_2_0
//			name = String.Empty;
#endif
            portTypes = new PortTypeCollection(this);

            serviceDescriptions = null;
            services            = new ServiceCollection(this);
            targetNamespace     = null;
            types = new Types();
        }
Exemple #40
0
        private static void UpdatePolicyReference(WsdlNS.ServiceDescriptionFormatExtensionCollection extensions, string oldBindingName, string newBindingName)
        {
            IEnumerable <XmlElement> bindingPolicyReferences = FindAllElements(extensions, MetadataStrings.WSPolicy.Elements.PolicyReference);
            string policyReferencePrefixFormat = "#{0}_";

            foreach (XmlElement policyReferenceElement in bindingPolicyReferences)
            {
                XmlNode policyReference      = policyReferenceElement.Attributes.GetNamedItem(MetadataStrings.WSPolicy.Attributes.URI);
                string  policyReferenceValue = policyReference.Value;
                string  policyReferenceValueWithOldBindingName = string.Format(CultureInfo.InvariantCulture, policyReferencePrefixFormat, oldBindingName);
                string  policyReferenceValueWithNewBindingName = string.Format(CultureInfo.InvariantCulture, policyReferencePrefixFormat, newBindingName);
                if (policyReference != null && policyReferenceValue != null && policyReferenceValue.StartsWith(policyReferenceValueWithOldBindingName, StringComparison.Ordinal))
                {
                    policyReference.Value = policyReferenceValueWithNewBindingName + policyReference.Value.Substring(policyReferenceValueWithOldBindingName.Length);
                }
            }
        }
        void AddExtensionNamespaces(XmlSerializerNamespaces ns, ServiceDescriptionFormatExtensionCollection extensions)
        {
            foreach (object o in extensions)
            {
                ServiceDescriptionFormatExtension ext = o as ServiceDescriptionFormatExtension;
                if (ext == null)
                {
                    // o can be XmlElement, skipping that
                    continue;
                }

                ExtensionInfo einf = ExtensionManager.GetFormatExtensionInfo(ext.GetType());
                foreach (XmlQualifiedName qname in einf.NamespaceDeclarations)
                {
                    ns.Add(qname.Name, qname.Namespace);
                }
            }
        }
        internal static void WriteExtensions(XmlWriter writer, object ob)
        {
            ServiceDescriptionFormatExtensionCollection extensions = ExtensionManager.GetExtensionPoint(ob);

            if (extensions != null)
            {
                foreach (object o in extensions)
                {
                    if (o is ServiceDescriptionFormatExtension)
                    {
                        WriteExtension(writer, (ServiceDescriptionFormatExtension)o);
                    }
                    else if (o is XmlElement)
                    {
                        ((XmlElement)o).WriteTo(writer);
                    }
                }
            }
        }
 public void AddExtensionWarningComments(CodeCommentStatementCollection comments, ServiceDescriptionFormatExtensionCollection extensions)
 {
     foreach (object obj2 in extensions)
     {
         if (!extensions.IsHandled(obj2))
         {
             string localName = null;
             string namespaceURI = null;
             if (obj2 is XmlElement)
             {
                 XmlElement element = (XmlElement) obj2;
                 localName = element.LocalName;
                 namespaceURI = element.NamespaceURI;
             }
             else if (obj2 is ServiceDescriptionFormatExtension)
             {
                 XmlFormatExtensionAttribute[] customAttributes = (XmlFormatExtensionAttribute[]) obj2.GetType().GetCustomAttributes(typeof(XmlFormatExtensionAttribute), false);
                 if (customAttributes.Length > 0)
                 {
                     localName = customAttributes[0].ElementName;
                     namespaceURI = customAttributes[0].Namespace;
                 }
             }
             if (localName != null)
             {
                 if (extensions.IsRequired(obj2))
                 {
                     this.warnings |= ServiceDescriptionImportWarnings.RequiredExtensionsIgnored;
                     AddWarningComment(comments, System.Web.Services.Res.GetString("WebServiceDescriptionIgnoredRequired", new object[] { localName, namespaceURI }));
                 }
                 else
                 {
                     this.warnings |= ServiceDescriptionImportWarnings.OptionalExtensionsIgnored;
                     AddWarningComment(comments, System.Web.Services.Res.GetString("WebServiceDescriptionIgnoredOptional", new object[] { localName, namespaceURI }));
                 }
             }
         }
     }
 }
Exemple #44
0
		public OutputBinding ()
		{
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
		}
Exemple #45
0
		public ServiceDescription ()
		{
			bindings = new BindingCollection (this);
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
			imports = new ImportCollection (this);
			messages = new MessageCollection (this);
#if !NET_2_0
//			name = String.Empty;		
#endif
			portTypes = new PortTypeCollection (this);

			serviceDescriptions = null;
			services = new ServiceCollection (this);
			targetNamespace = null;
			types = new Types ();
		}
Exemple #46
0
		void AddExtensionNamespaces (XmlSerializerNamespaces ns, ServiceDescriptionFormatExtensionCollection extensions)
		{
			foreach (object o in extensions)
			{
				ServiceDescriptionFormatExtension ext = o as ServiceDescriptionFormatExtension;
				if (ext == null)
					// o can be XmlElement, skipping that
					continue;

				ExtensionInfo einf = ExtensionManager.GetFormatExtensionInfo (ext.GetType ());
				foreach (XmlQualifiedName qname in einf.NamespaceDeclarations)
					ns.Add (qname.Name, qname.Namespace);
			}
		}
Exemple #47
0
 static void CheckExtensions(ConformanceCheckContext ctx, ConformanceChecker checker, ServiceDescriptionFormatExtensionCollection extensions)
 {
     foreach (object o in extensions)
     {
         ServiceDescriptionFormatExtension ext = o as ServiceDescriptionFormatExtension;
         if (ext != null)
         {
             checker.Check(ctx, ext);
         }
     }
 }
		public MimePart ()
		{
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
		}
Exemple #49
0
		public OperationFault ()
		{
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
		}
 /// <include file='doc\ProtocolImporter.uex' path='docs/doc[@for="ProtocolImporter.AddExtensionWarningComments"]/*' />
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public void AddExtensionWarningComments(CodeCommentStatementCollection comments, ServiceDescriptionFormatExtensionCollection extensions) {
     foreach (object item in extensions) {
         if (!extensions.IsHandled(item)) {
             string name = null;
             string ns = null;
             if (item is XmlElement) {
                 XmlElement element = (XmlElement)item;
                 name = element.LocalName;
                 ns = element.NamespaceURI;
             }
             else if (item is ServiceDescriptionFormatExtension) {
                 XmlFormatExtensionAttribute[] attrs = (XmlFormatExtensionAttribute[])item.GetType().GetCustomAttributes(typeof(XmlFormatExtensionAttribute), false);
                 if (attrs.Length > 0) {
                     name = attrs[0].ElementName;
                     ns = attrs[0].Namespace;
                 }
             }
             if (name != null) {
                 if (extensions.IsRequired(item)) {
                     warnings |= ServiceDescriptionImportWarnings.RequiredExtensionsIgnored;
                     AddWarningComment(comments, Res.GetString(Res.WebServiceDescriptionIgnoredRequired, name, ns));
                 }
                 else {
                     warnings |= ServiceDescriptionImportWarnings.OptionalExtensionsIgnored;
                     AddWarningComment(comments, Res.GetString(Res.WebServiceDescriptionIgnoredOptional, name, ns));
                 }
             }
         }
     }
 }
Exemple #51
0
 public void AddExtensionWarningComments(CodeCommentStatementCollection comments, ServiceDescriptionFormatExtensionCollection extensions)
 {
     throw new NotImplementedException();
 }
Exemple #52
0
 public MimePart()
 {
     extensions = new ServiceDescriptionFormatExtensionCollection(this);
 }
Exemple #53
0
 public InputBinding()
 {
     extensions = new ServiceDescriptionFormatExtensionCollection(this);
 }
 public Types()
 {
     extensions = new ServiceDescriptionFormatExtensionCollection(this);
     schemas    = new XmlSchemas();
 }
 /// <include file='doc\ProtocolImporter.uex' path='docs/doc[@for="ProtocolImporter.AddExtensionWarningComments"]/*' />
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public void AddExtensionWarningComments(CodeCommentStatementCollection comments, ServiceDescriptionFormatExtensionCollection extensions)
 {
     foreach (object item in extensions)
     {
         if (!extensions.IsHandled(item))
         {
             string name = null;
             string ns   = null;
             if (item is XmlElement)
             {
                 XmlElement element = (XmlElement)item;
                 name = element.LocalName;
                 ns   = element.NamespaceURI;
             }
             else if (item is ServiceDescriptionFormatExtension)
             {
                 XmlFormatExtensionAttribute[] attrs = (XmlFormatExtensionAttribute[])item.GetType().GetCustomAttributes(typeof(XmlFormatExtensionAttribute), false);
                 if (attrs.Length > 0)
                 {
                     name = attrs[0].ElementName;
                     ns   = attrs[0].Namespace;
                 }
             }
             if (name != null)
             {
                 if (extensions.IsRequired(item))
                 {
                     warnings |= ServiceDescriptionImportWarnings.RequiredExtensionsIgnored;
                     AddWarningComment(comments, Res.GetString(Res.WebServiceDescriptionIgnoredRequired, name, ns));
                 }
                 else
                 {
                     warnings |= ServiceDescriptionImportWarnings.OptionalExtensionsIgnored;
                     AddWarningComment(comments, Res.GetString(Res.WebServiceDescriptionIgnoredOptional, name, ns));
                 }
             }
         }
     }
 }
		static void CheckExtensions (ConformanceCheckContext ctx, ConformanceChecker checker, ServiceDescriptionFormatExtensionCollection extensions)
		{
			foreach (ServiceDescriptionFormatExtension ext in extensions)
				checker.Check (ctx, ext);
		}
Exemple #57
0
		public Message ()
		{
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
			parts = new MessagePartCollection (this);
			serviceDescription = null;
		}
		public Types ()
		{
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
			schemas = new XmlSchemas ();
		}
Exemple #59
0
		public Service ()
		{
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
			ports = new PortCollection (this);
			serviceDescription = null;
		}
Exemple #60
0
		public PortType ()
		{
			operations = new OperationCollection (this);
			serviceDescription = null;
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
		}