Ejemplo n.º 1
1
		public Binding ()
		{
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
			operations = new OperationBindingCollection (this);
			serviceDescription = null;
			type = XmlQualifiedName.Empty;
		}
Ejemplo n.º 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"));
		}
Ejemplo n.º 5
0
        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
        }
Ejemplo n.º 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)));
		}
Ejemplo n.º 8
0
 public Binding()
 {
     extensions         = new ServiceDescriptionFormatExtensionCollection(this);
     operations         = new OperationBindingCollection(this);
     serviceDescription = null;
     type = XmlQualifiedName.Empty;
 }
Ejemplo n.º 9
0
		public MessagePart ()
		{
			element = XmlQualifiedName.Empty;
			message = null;
			type = XmlQualifiedName.Empty;
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
		}
Ejemplo n.º 10
0
 public OperationBinding()
 {
     extensions = new ServiceDescriptionFormatExtensionCollection(this);
     faults     = new FaultBindingCollection(this);
     input      = null;
     output     = null;
 }
Ejemplo n.º 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);
                    }
                }
            }
Ejemplo n.º 13
0
 public MessagePart()
 {
     element    = XmlQualifiedName.Empty;
     message    = null;
     type       = XmlQualifiedName.Empty;
     extensions = new ServiceDescriptionFormatExtensionCollection(this);
 }
Ejemplo n.º 14
0
        public PortType()
        {
            operations         = new OperationCollection(this);
            serviceDescription = null;
#if NET_2_0
            extensions = new ServiceDescriptionFormatExtensionCollection(this);
#endif
        }
Ejemplo n.º 15
0
 public Operation()
 {
     faults         = new OperationFaultCollection(this);
     messages       = new OperationMessageCollection(this);
     parameterOrder = null;
     portType       = null;
     extensions     = new ServiceDescriptionFormatExtensionCollection(this);
 }
Ejemplo n.º 16
0
		public PortType ()
		{
			operations = new OperationCollection (this);
			serviceDescription = null;
#if NET_2_0
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
#endif
		}
Ejemplo n.º 17
0
		public Operation ()
		{
			faults = new OperationFaultCollection (this);
			messages = new OperationMessageCollection (this);
			parameterOrder = null;
			portType = null;
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
		}
Ejemplo n.º 18
0
        public Service()
        {
            extensions = new ServiceDescriptionFormatExtensionCollection(this);
#if !NET_2_0
            name = String.Empty;
#endif
            ports = new PortCollection(this);
            serviceDescription = null;
        }
Ejemplo n.º 19
0
		public Service ()
		{
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
#if !NET_2_0
			name = String.Empty;
#endif
			ports = new PortCollection (this);
			serviceDescription = null;
		}
Ejemplo n.º 20
0
		public Port ()
		{
			binding = null;
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
#if !NET_2_0
			name = String.Empty;
#endif
			service = null;
		}
Ejemplo n.º 21
0
        public Port()
        {
            binding    = null;
            extensions = new ServiceDescriptionFormatExtensionCollection(this);
#if !NET_2_0
            name = String.Empty;
#endif
            service = null;
        }
Ejemplo n.º 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;
		}
Ejemplo n.º 24
0
        public OperationBinding()
        {
            extensions = new ServiceDescriptionFormatExtensionCollection(this);
            faults     = new FaultBindingCollection(this);
            input      = null;
#if !NET_2_0
            name = String.Empty;
#endif
            output = null;
        }
Ejemplo n.º 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;
		}
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
		}
Ejemplo n.º 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);
         }
     }
 }
Ejemplo n.º 29
0
 private static bool CheckExtensions(ServiceDescriptionFormatExtensionCollection extensions)
 {
     foreach (ServiceDescriptionFormatExtension extension in extensions)
     {
         if (extension.Required)
         {
             return(false);
         }
     }
     return(true);
 }
Ejemplo n.º 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
        }
Ejemplo n.º 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
		}
Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 33
0
        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);
        }
Ejemplo n.º 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
        }
Ejemplo n.º 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
		}
Ejemplo n.º 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 ();
		}
Ejemplo n.º 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();
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 39
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();
        }
Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 41
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);
                }
            }
        }
Ejemplo n.º 42
0
        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 }));
                 }
             }
         }
     }
 }
Ejemplo n.º 44
0
		public OutputBinding ()
		{
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
		}
Ejemplo n.º 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 ();
		}
Ejemplo n.º 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);
			}
		}
Ejemplo n.º 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);
         }
     }
 }
Ejemplo n.º 48
0
		public MimePart ()
		{
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
		}
Ejemplo n.º 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));
                 }
             }
         }
     }
 }
Ejemplo n.º 51
0
 public void AddExtensionWarningComments(CodeCommentStatementCollection comments, ServiceDescriptionFormatExtensionCollection extensions)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 52
0
 public MimePart()
 {
     extensions = new ServiceDescriptionFormatExtensionCollection(this);
 }
Ejemplo n.º 53
0
 public InputBinding()
 {
     extensions = new ServiceDescriptionFormatExtensionCollection(this);
 }
Ejemplo n.º 54
0
 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);
		}
Ejemplo n.º 57
0
		public Message ()
		{
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
			parts = new MessagePartCollection (this);
			serviceDescription = null;
		}
Ejemplo n.º 58
0
		public Types ()
		{
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
			schemas = new XmlSchemas ();
		}
Ejemplo n.º 59
0
		public Service ()
		{
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
			ports = new PortCollection (this);
			serviceDescription = null;
		}
Ejemplo n.º 60
0
		public PortType ()
		{
			operations = new OperationCollection (this);
			serviceDescription = null;
			extensions = new ServiceDescriptionFormatExtensionCollection (this);
		}