当前位置: 首页>>代码示例>>C#>>正文


C# Description.ConformanceCheckContext类代码示例

本文整理汇总了C#中System.Web.Services.Description.ConformanceCheckContext的典型用法代码示例。如果您正苦于以下问题:C# ConformanceCheckContext类的具体用法?C# ConformanceCheckContext怎么用?C# ConformanceCheckContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ConformanceCheckContext类属于System.Web.Services.Description命名空间,在下文中一共展示了ConformanceCheckContext类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CheckConformance

		public static bool CheckConformance (WsiClaims claims, ServiceDescription service, BasicProfileViolationCollection violations)
		{
			ServiceDescriptionCollection col = new ServiceDescriptionCollection ();
			col.Add (service);
			ConformanceCheckContext ctx = new ConformanceCheckContext (col, violations);
			return Check (claims, ctx, col);
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:7,代码来源:WebServicesInteroperability.cs

示例2: GetAbsoluteUri

		/*
		private string GetAbsoluteUri (string baseUri, string relativeUri)
		{
			string actualBaseUri = baseUri ?? Path.GetFullPath (".") + Path.DirectorySeparatorChar;
			Uri uri = new Uri (new Uri (actualBaseUri), relativeUri);
			return uri.ToString ();
		}
		*/

		public override void Check (ConformanceCheckContext ctx, Import value) 
		{
			if (value.Location == "" || value.Location == null) {
				ctx.ReportRuleViolation (value, BasicProfileRules.R2007);
				return;
			}
			
			if (!new Uri (value.Namespace, UriKind.RelativeOrAbsolute).IsAbsoluteUri)
				ctx.ReportRuleViolation (value, BasicProfileRules.R2803);

			// LAMESPEC: RetrievalUrl does not seem to help here (in .NET)
			//ServiceDescription importer = value.ServiceDescription;
			//string absUri = GetAbsoluteUri (importer != null ? importer.RetrievalUrl : null, value.Location);
			object doc = ctx.GetDocument (/*absUri*/value.Location, value.Namespace);
			if (doc == null) // and looks like .net ignores non-resolvable documentation... I dunno if it makes sense. I don't care :/
				return; //ctx.ReportError (value, "Document '" + value.Location + "' not found");
			
			if (doc is XmlSchema)
				ctx.ReportRuleViolation (value, BasicProfileRules.R2002);
				
			ServiceDescription imported = doc as ServiceDescription;
			if (imported == null) {
				ctx.ReportRuleViolation (value, BasicProfileRules.R2001);
				return;
			}
				
			if (imported.TargetNamespace != value.Namespace)
				ctx.ReportRuleViolation (value, BasicProfileRules.R2005);
		}
开发者ID:nobled,项目名称:mono,代码行数:38,代码来源:BasicProfileChecker.cs

示例3: Check

		public override void Check (ConformanceCheckContext ctx, MessagePart value)
		{
			CheckWsdlQName (ctx, value, value.Type);
			CheckWsdlQName (ctx, value, value.Element);
			
			if (value.DefinedByElement && value.Element.Namespace == XmlSchema.Namespace)
				ctx.ReportRuleViolation (value, BasicProfileRules.R2206);
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:8,代码来源:BasicProfileChecker.cs

示例4: Check

		static bool Check (WsiClaims claims, ConformanceCheckContext ctx, IEnumerable documents)
		{
			ConformanceChecker[] checkers = GetCheckers (claims);
			if (checkers == null) return true;
			
			foreach (object doc in documents) {
				if (!(doc is ServiceDescription)) continue;
				
				foreach (ConformanceChecker c in checkers)
					Check (ctx, c, (ServiceDescription)doc);
			}
				
			return ctx.Violations.Count == 0;
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:14,代码来源:WebServicesInteroperability.cs

示例5: Check

		internal static void Check (ConformanceCheckContext ctx, ConformanceChecker checker, Binding b)
		{
			checker.Check (ctx, b);
			CheckExtensions (ctx, checker, b.Extensions);

			foreach (OperationBinding oper in b.Operations) {
				CheckExtensions (ctx, checker, oper.Extensions);

				foreach (MessageBinding mb in oper.Faults) {
					checker.Check (ctx, mb);
					CheckExtensions (ctx, checker, mb.Extensions);
				}

				checker.Check (ctx, oper.Input);
				CheckExtensions (ctx, checker, oper.Input.Extensions);

				checker.Check (ctx, oper.Output);
				CheckExtensions (ctx, checker, oper.Output.Extensions);
			}
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:20,代码来源:WebServicesInteroperability.cs

示例6: CheckObjects

		static void CheckObjects (ConformanceCheckContext ctx, ConformanceChecker checker, Hashtable visitedObjects, XmlSchemaObjectCollection col)
		{
			foreach (XmlSchemaObject item in col)
				Check (ctx, checker, visitedObjects, item);
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:5,代码来源:WebServicesInteroperability.cs

示例7: CheckWsdlQName

		// Helper methods
		
		void CheckWsdlQName (ConformanceCheckContext ctx, object element, XmlQualifiedName name)
		{
			if (name == null || name == XmlQualifiedName.Empty) return;
			if (name.Namespace == "" || name.Namespace == XmlSchema.Namespace) return;
			
			if (ctx.ServiceDescription.Types != null && ctx.ServiceDescription.Types.Schemas != null) 
			{
				foreach (XmlSchema s in ctx.ServiceDescription.Types.Schemas)
				{
					if (s.TargetNamespace == name.Namespace) return;
					foreach (XmlSchemaObject i in s.Includes)
						if ((i is XmlSchemaImport) && ((XmlSchemaImport)i).Namespace == name.Namespace) return;
				}
			}
			ctx.ReportRuleViolation (element, BasicProfileRules.R2101);
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:18,代码来源:BasicProfileChecker.cs

示例8: CheckSchemaQName

		void CheckSchemaQName (ConformanceCheckContext ctx, object element, XmlQualifiedName name)
		{
			if (name == null || name == XmlQualifiedName.Empty) return;
			if (name.Namespace == "" || name.Namespace == XmlSchema.Namespace) return;
			if (ctx.CurrentSchema.TargetNamespace == name.Namespace) return;
			
			foreach (XmlSchemaObject i in ctx.CurrentSchema.Includes)
				if ((i is XmlSchemaImport) && ((XmlSchemaImport)i).Namespace == name.Namespace) return;
				
			ctx.ReportRuleViolation (element, BasicProfileRules.R2102);
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:11,代码来源:BasicProfileChecker.cs

示例9: CheckExtensions

		static void CheckExtensions (ConformanceCheckContext ctx, ConformanceChecker checker, ServiceDescriptionFormatExtensionCollection extensions)
		{
			foreach (ServiceDescriptionFormatExtension ext in extensions)
				checker.Check (ctx, ext);
		}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:5,代码来源:WebServicesInteroperability.cs

示例10: ImportBinding

		void ImportBinding (ServiceDescription desc, Service service, TypeStubInfo typeInfo, string url, BindingInfo binfo)
		{
			port = new Port ();
			port.Name = portNames.AddUnique (binfo.Name, port);
			bool bindingFull = true;

			if (binfo.Namespace != desc.TargetNamespace)
			{
				if (binfo.Location == null || binfo.Location == string.Empty)
				{
					ServiceDescription newDesc = new ServiceDescription();
					newDesc.TargetNamespace = binfo.Namespace;
					newDesc.Name = binfo.Name;
					bindingFull = ImportBindingContent (newDesc, typeInfo, url, binfo);
					if (bindingFull) {
						int id = ServiceDescriptions.Add (newDesc);
						AddImport (desc, binfo.Namespace, GetWsdlUrl (url,id));
					}
				}
				else {
					AddImport (desc, binfo.Namespace, binfo.Location);
					bindingFull = true;
				}
			}
			else
				bindingFull = ImportBindingContent (desc, typeInfo, url, binfo);
				
			if (bindingFull)
			{
				port.Binding = new XmlQualifiedName (binding.Name, binfo.Namespace);
				
				int n = 0;
				string name = binfo.Name; 
				bool found;
				do {

					found = false;
					foreach (Port p in service.Ports)
						if (p.Name == name) { found = true; n++; name = binfo.Name + n; break; }
				}
				while (found);
				port.Name = name;
				service.Ports.Add (port);
			}

			if (binfo.WebServiceBindingAttribute != null && binfo.WebServiceBindingAttribute.ConformsTo != WsiProfiles.None && String.IsNullOrEmpty (binfo.WebServiceBindingAttribute.Name)) {
				BasicProfileViolationCollection violations = new BasicProfileViolationCollection ();
				desc.Types.Schemas.Add (Schemas);
				ServiceDescriptionCollection col = new ServiceDescriptionCollection ();
				col.Add (desc);
				ConformanceCheckContext ctx = new ConformanceCheckContext (col, violations);
				ctx.ServiceDescription = desc;
				ConformanceChecker[] checkers = WebServicesInteroperability.GetCheckers (binfo.WebServiceBindingAttribute.ConformsTo);
				foreach (ConformanceChecker checker in checkers) {
					ctx.Checker = checker;
					WebServicesInteroperability.Check (ctx, checker, binding);
					if (violations.Count > 0)
						throw new InvalidOperationException (violations [0].ToString ());
				}
			}
		}
开发者ID:Profit0004,项目名称:mono,代码行数:61,代码来源:ProtocolReflector.cs


注:本文中的System.Web.Services.Description.ConformanceCheckContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。