• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Description.Binding类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: WsdlEndpointConversionContext

		internal WsdlEndpointConversionContext (WsdlContractConversionContext context, ServiceEndpoint endpoint, Port port, WSBinding wsdlBinding)
		{
			this.context = context;
			this.endpoint = endpoint;
			this.port = port;
			this.wsdl_binding = wsdlBinding;
		}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:WsdlEndpointConversionContext.cs


示例2: GetServiceType

        static Type GetServiceType(Binding soapBinding, Assembly assembly)
        {
            foreach (var type in assembly.GetTypes())
            {
                var bindingAttribute = type.GetCustomAttributes(typeof (WebServiceBindingAttribute), false)
                    .Cast<WebServiceBindingAttribute>().SingleOrDefault();
                if (bindingAttribute != null && bindingAttribute.Name == soapBinding.Name)
                    return type;
            }

            return null;

            //var serviceTypes = new List<Type>();

            //// FIXME: Best way to match the service/binding to the implementing type
            ////

            //foreach (var type in assembly.GetTypes())
            //{
            //    var bindingAttributes = type.GetCustomAttributes(typeof (WebServiceBindingAttribute), false);
            //    if (bindingAttributes.Length != 0) serviceTypes.Add(type);
            //}

            //var name = soapBinding.Type.Name;
            //return string.IsNullOrEmpty(name)
            //    ? new Type[0]
            //    : serviceTypes.Where(t => t.Name == name || t.Name.EndsWith(name));
        }
开发者ID:phaufe,项目名称:SoapContextDriver,代码行数:28,代码来源:SchemaBuilder.cs


示例3: CustomPolicyConversionContext

		public CustomPolicyConversionContext (WS.Binding binding, ServiceEndpoint endpoint)
			: base (endpoint)
		{
			this.binding = binding;
			assertions = new PolicyAssertionCollection ();
			binding_elements = ((CustomBinding)endpoint.Binding).Elements;
		}
开发者ID:Profit0004,项目名称:mono,代码行数:7,代码来源:CustomPolicyConversionContext.cs


示例4: GetListOfOperations

        //DONE
        //This method generates a list of operations from a web service description. Returns a list of the
        //webservice's operations on success, and null on failure.
        public string[] GetListOfOperations(string webServiceURL)
        {
            List<string> ListOfOperations = new List<string>();
            WebClient webServiceClient = new WebClient();
            Binding binding = new Binding();

            try
            {
                Stream serviceStream = webServiceClient.OpenRead(webServiceURL + "?wsdl");
                //This gets the WSDL file...
                ServiceDescription webServiceDescription = ServiceDescription.Read(serviceStream);

                //Get a list of operations from the web service description...
                binding = webServiceDescription.Bindings[0];
                OperationBindingCollection operationCollection = binding.Operations;

                foreach (OperationBinding operation in operationCollection)
                {
                    ListOfOperations.Add(operation.Name);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return ListOfOperations.ToArray();
        }
开发者ID:anthony-salutari,项目名称:SOA-Assignment-2,代码行数:31,代码来源:WebServiceCaller.cs


示例5: BuildEntities

        static List<ExplorerItem> BuildEntities(Type serviceType, Binding soapBinding)
        {
            var list = new List<ExplorerItem>();
            foreach (var operation in GetSoapOperations(soapBinding))
                list.Add(CreateExplorerOperation(serviceType, operation));

            return list;
        }
开发者ID:phaufe,项目名称:SoapContextDriver,代码行数:8,代码来源:SchemaBuilder.cs


示例6: TestAddBinding

		public void TestAddBinding ()
		{
			const string bindingName = "testBinding";
			
			Binding b = new Binding ();
			b.Name = bindingName;
			
			bc.Add (b);

			Assert.AreEqual (1, bc.Count);
			Assert.AreEqual (b, bc[bindingName]);
		}
开发者ID:nobled,项目名称:mono,代码行数:12,代码来源:BindingCollectionTest.cs


示例7: FindOperation

        OperationBinding FindOperation(Binding binding, string name)
        {
            foreach (OperationBinding oper in binding.Operations) {
                if (oper.Input.Name != null) {
                    if (oper.Input.Name == name) return oper;
                }
                else
                    if (oper.Name == name) return oper;
            }

            return null;
        }
开发者ID:umabiel,项目名称:WsdlUI,代码行数:12,代码来源:SampleGeneratorWebSvc.cs


示例8: GetServiceType

        private static Type GetServiceType(Binding soapBinding, Assembly assembly)
        {
            foreach (var type in assembly.GetTypes())
            {
                var bindingAttribute = type.GetCustomAttributes(typeof (WebServiceBindingAttribute), false)
                    .Cast<WebServiceBindingAttribute>().SingleOrDefault();
                if (bindingAttribute != null && bindingAttribute.Name == soapBinding.Name)
                    return type;
            }

            return null;
        }
开发者ID:flex87,项目名称:linqpad-soap-driver,代码行数:12,代码来源:SchemaBuilder.cs


示例9: WsdlEndpointConversionContext

 internal WsdlEndpointConversionContext(WsdlContractConversionContext contractContext, ServiceEndpoint endpoint, Binding wsdlBinding, Port wsdlport)
 {
     this.endpoint = endpoint;
     this.wsdlBinding = wsdlBinding;
     this.wsdlPort = wsdlport;
     this.contractContext = contractContext;
     this.wsdlOperationBindings = new Dictionary<OperationDescription, OperationBinding>();
     this.operationDescriptionBindings = new Dictionary<OperationBinding, OperationDescription>();
     this.wsdlMessageBindings = new Dictionary<MessageDescription, MessageBinding>();
     this.messageDescriptionBindings = new Dictionary<MessageBinding, MessageDescription>();
     this.wsdlFaultBindings = new Dictionary<FaultDescription, FaultBinding>();
     this.faultDescriptionBindings = new Dictionary<FaultBinding, FaultDescription>();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:13,代码来源:WsdlEndpointConversionContext.cs


示例10: 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


示例11: Remove

 /// <include file='doc\ServiceDescription.uex' path='docs/doc[@for="BindingCollection.Remove"]/*' />
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public void Remove(Binding binding) {
     List.Remove(binding);
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:ServiceDescription.cs


示例12: Contains

 /// <include file='doc\ServiceDescription.uex' path='docs/doc[@for="BindingCollection.Contains"]/*' />
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public bool Contains(Binding binding) {
     return List.Contains(binding);
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:ServiceDescription.cs


示例13: IndexOf

 /// <include file='doc\ServiceDescription.uex' path='docs/doc[@for="BindingCollection.IndexOf"]/*' />
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public int IndexOf(Binding binding) {
     return List.IndexOf(binding);
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:ServiceDescription.cs


示例14: Insert

 /// <include file='doc\ServiceDescription.uex' path='docs/doc[@for="BindingCollection.Insert"]/*' />
 /// <devdoc>
 ///    <para>[To be supplied.]</para>
 /// </devdoc>
 public void Insert(int index, Binding binding) {
     List.Insert(index, binding);
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:ServiceDescription.cs


示例15: MoveToBinding

 void MoveToBinding(Service service, Port port, Binding binding, PortType portType) {
     this.service = service;
     this.port = port;
     this.portType = portType;
     this.binding = binding;
     this.encodedBinding = false;
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:7,代码来源:ProtocolImporter.cs


示例16: ExportService

		Port ExportService (WSServiceDescription sd, WSBinding ws_binding, EndpointAddress address, bool msg_version_none)
		{
			if (address == null)
				return null;

			Service ws_svc = GetService (sd, "service");
			sd.Name = "service";

				Port ws_port = new Port ();
				ws_port.Name = ws_binding.Name;
				ws_port.Binding = new QName (ws_binding.Name, sd.TargetNamespace);

				if (!msg_version_none) {
					SoapAddressBinding soap_addr = new SoapAddressBinding ();
					soap_addr.Location = address.Uri.AbsoluteUri;

					ws_port.Extensions.Add (soap_addr);
				}

			ws_svc.Ports.Add (ws_port);

			return ws_port;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:23,代码来源:WsdlExporter.cs


示例17: SetParent

 internal void SetParent(Binding parent) {
     this.parent = parent;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:3,代码来源:ServiceDescription.cs


示例18: ExportEndpoint_Internal

		EndpointExportMap ExportEndpoint_Internal (ServiceEndpoint endpoint)
		{
			var map = ExportedEndpoints.FirstOrDefault (m => m.Endpoint == endpoint);
			if (map != null)
				return map;

			int index = 0;
			var baseName = String.Concat (endpoint.Binding.Name, "_", endpoint.Contract.Name);
			var name = baseName;
			while (ExportedEndpoints.Exists (m => m.Name == name))
				name = String.Concat (baseName, (++index).ToString ());

			map = new EndpointExportMap (name, endpoint);
			ExportedEndpoints.Add (map);

			var contract = ExportContractInternal (endpoint.Contract);

			//FIXME: Namespace
			WSServiceDescription sd = GetServiceDescription ("http://tempuri.org/");
			if (sd.TargetNamespace != endpoint.Contract.Namespace) {
				sd.Namespaces.Add ("i0", endpoint.Contract.Namespace);

				//Import
				Import import = new Import ();
				import.Namespace = endpoint.Contract.Namespace;

				sd.Imports.Add (import);
			}
			
			if (endpoint.Binding == null)
				throw new ArgumentException (String.Format (
					"Binding for ServiceEndpoint named '{0}' is null",
					endpoint.Name));

			var extensions = new List<IWsdlExportExtension> ();
			var extensionTypes = new Dictionary<Type, IWsdlExportExtension> ();
			if (contract.Results != null) {
				foreach (var extension in contract.Results) {
					var type = extension.GetType ();
					if (extensionTypes.ContainsKey (type))
						continue;
					extensionTypes.Add (type, extension);
					extensions.Add (extension);
				}
			}

			var bindingElements = endpoint.Binding.CreateBindingElements ();
			foreach (var element in bindingElements) {
				var extension = element as IWsdlExportExtension;
				if (extension == null)
					continue;
				var type = extension.GetType ();
				if (extensionTypes.ContainsKey (type))
					continue;
				extensionTypes.Add (type, extension);
				extensions.Add (extension);
			}

			//ExportBinding
			WSBinding ws_binding = new WSBinding ();
			
			//<binding name = .. 
			ws_binding.Name = name;

			//<binding type = ..
			ws_binding.Type = new QName (endpoint.Contract.Name, endpoint.Contract.Namespace);
			sd.Bindings.Add (ws_binding);

			//	<operation
			foreach (OperationDescription sm_op in endpoint.Contract.Operations) {
				var op_binding = CreateOperationBinding (endpoint, sm_op);
				ws_binding.Operations.Add (op_binding);
			}

			//Add <service
			Port ws_port = ExportService (sd, ws_binding, endpoint.Address);

			//Call IWsdlExportExtension.ExportEndpoint
			WsdlContractConversionContext contract_context = new WsdlContractConversionContext (
				endpoint.Contract, sd.PortTypes [endpoint.Contract.Name]);
			WsdlEndpointConversionContext endpoint_context = new WsdlEndpointConversionContext (
				contract_context, endpoint, ws_port, ws_binding);

			foreach (var extension in extensions) {
				try {
					extension.ExportEndpoint (this, endpoint_context);
				} catch (Exception ex) {
					var error = AddError (
						"Failed to export endpoint '{0}': wsdl exporter '{1}' " +
						"threw an exception: {2}", endpoint.Name, extension.GetType (), ex);
					throw new MetadataExportException (error, ex);
				}
			}

			try {
				ExportPolicy (endpoint, ws_binding);
			} catch (MetadataExportException) {
				throw;
			} catch (Exception ex) {
				var error = AddError (
//.........这里部分代码省略.........
开发者ID:petermdobson,项目名称:mono-1,代码行数:101,代码来源:WsdlExporter.cs


示例19: SetParent

		internal void SetParent (Binding binding) 
		{
			this.binding = binding; 
		} 
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:4,代码来源:OperationBinding.cs


示例20: GetOperationBinding

		OperationBinding GetOperationBinding (WSBinding b, string name, string label)
		{
			foreach (OperationBinding op in b.Operations)
				if (op.Name == name)
					return op;

			Assert.Fail (String.Format ("[{0}] OperationBinding named '{1}' not found.", label, name));
			return null;
		}
开发者ID:nlhepler,项目名称:mono,代码行数:9,代码来源:WsdlExporterTest.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Description.ConformanceCheckContext类代码示例发布时间:2022-05-26
下一篇:
C# Security.ValidatePasswordEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap