private static void RemovePolicyFormatFromBinding(BindingCollection bindings)
 {
     foreach (Binding binding in bindings)
     {
         foreach (OperationBinding opBinding in binding.Operations)
         {
             RemovePolicyFormatFromExtensions(opBinding.Extensions);
         }
     }
 }
Exemple #2
0
        private static bool IsBindingNameUsed(string name, object collection)
        {
            WsdlNS.BindingCollection bindings = (WsdlNS.BindingCollection)collection;
            foreach (WsdlNS.Binding binding in bindings)
            {
                if (binding.Name == name)
                {
                    return(true);
                }
            }

            return(false);
        }
		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 #4
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();
        }
        public override void Check(ConformanceCheckContext ctx, BindingCollection value)
        {
            foreach (Binding b in value)
            {
                foreach (object ext in b.Extensions)
                {
                    if (ext.GetType() == typeof(SoapBinding))
                    {
                        return;
                    }
                }
            }

            ctx.ReportRuleViolation(value, BasicProfileRules.R2401);
        }
        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 #7
0
        public Parser(WSDescriber wsDesc, ref bool untrustedSSLSecureChannel, ref List<Param> respHeader)
        {
            HttpWebRequest wr = GetHttpWebReq(wsDesc);

            HttpWebResponse wres = null;
            try
            {
                wres = (HttpWebResponse)wr.GetResponse();
            }
            catch (WebException wex)
            {
                if (wex.Status == WebExceptionStatus.TrustFailure)
                {
                    ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };

                    wr = GetHttpWebReq(wsDesc);
                    wres = (HttpWebResponse)wr.GetResponse();

                    untrustedSSLSecureChannel = true;
                }
            }

            if (wres != null)
            {
                for (int i = 0; i < wres.Headers.Count; ++i)
                {
                    respHeader.Add(new Param() { Name = wres.Headers.Keys[i].ToLowerInvariant(), Value = wres.Headers[i].ToLowerInvariant() });
                }

                StreamReader streamReader = new StreamReader(wres.GetResponseStream());

                rawWSDL = XDocument.Parse(streamReader.ReadToEnd());

                TextReader myTextReader = new StringReader(rawWSDL.ToString());
                serviceDescription = ServiceDescription.Read(myTextReader);

                TargetNameSpace = serviceDescription.TargetNamespace;
                bindColl = serviceDescription.Bindings;
                portTypColl = serviceDescription.PortTypes;
                msgColl = serviceDescription.Messages;
                types = serviceDescription.Types;
                schemas = types.Schemas;
            }
        }
Exemple #8
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 #9
0
		public void InitializeBindingCollection ()
		{
			// workaround for internal constructor
			ServiceDescription desc = new ServiceDescription ();
			bc = desc.Bindings;
		}
Exemple #10
0
 public virtual void Check(ConformanceCheckContext ctx, BindingCollection value)
 {
 }
Exemple #11
0
		public override void Check (ConformanceCheckContext ctx, BindingCollection value) {
			foreach (Binding b in value)
				foreach (object ext in b.Extensions)
					if (ext.GetType () == typeof (SoapBinding))
						return;

			ctx.ReportRuleViolation (value, BasicProfileRules.R2401);
		}
Exemple #12
0
		public virtual void Check (ConformanceCheckContext ctx, BindingCollection value) { }