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

C# Description.WsdlEndpointConversionContext类代码示例

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

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



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

示例1: CallExportEndpoint

 private void CallExportEndpoint(WsdlEndpointConversionContext endpointContext)
 {
     foreach (IWsdlExportExtension extension in endpointContext.ExportExtensions)
     {
         this.CallExtension(endpointContext, extension);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:WsdlExporter.cs


示例2: ArgumentNullException

        void IWsdlImportExtension.ImportEndpoint(WsdlImporter importer, WsdlEndpointConversionContext endpointContext)
        {
            if (endpointContext == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("endpointContext"));

            MessageContractImporter.ImportMessageBinding(importer, endpointContext, typeof(MessageContractImporter.XmlSerializerSchemaImporter));
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:7,代码来源:DataContractSerializerMessageContractImporter.cs


示例3: GetBindingElements

        void IWsdlImportExtension.ImportEndpoint(WsdlImporter importer, WsdlEndpointConversionContext context)
        {
            if (context == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
            }

#pragma warning suppress 56506 // [....], these properties cannot be null in this context
            if (context.Endpoint.Binding == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context.Endpoint.Binding");
            }

#pragma warning suppress 56506 // [....], CustomBinding.Elements never be null
            TransportBindingElement transportBindingElement = GetBindingElements(context).Find<TransportBindingElement>();

            bool transportHandledExternaly = (transportBindingElement != null) && !StateHelper.IsRegisteredTransportBindingElement(importer, context);
            if (transportHandledExternaly)
                return;

#pragma warning suppress 56506 // [....], these properties cannot be null in this context
            WsdlNS.SoapBinding soapBinding = (WsdlNS.SoapBinding)context.WsdlBinding.Extensions.Find(typeof(WsdlNS.SoapBinding));
            if (soapBinding != null && transportBindingElement == null)
            {
                CreateLegacyTransportBindingElement(importer, soapBinding, context);
            }

            // Try to import WS-Addressing address from the port
            if (context.WsdlPort != null)
            {
                ImportAddress(context, transportBindingElement);
            }

        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:34,代码来源:TransportBindingElementImporter.cs


示例4: ImportMessageBinding

        static internal void ImportMessageBinding(WsdlImporter importer, WsdlEndpointConversionContext endpointContext, Type schemaImporterType)
        {
            // All the work is done in ImportMessageContract call
            bool isReferencedContract = IsReferencedContract(importer, endpointContext);

            MarkSoapExtensionsAsHandled(endpointContext.WsdlBinding);

            foreach (WsdlNS.OperationBinding wsdlOperationBinding in endpointContext.WsdlBinding.Operations)
            {
                OperationDescription operation = endpointContext.GetOperationDescription(wsdlOperationBinding);
                if (isReferencedContract || OperationHasBeenHandled(operation))
                {
                    MarkSoapExtensionsAsHandled(wsdlOperationBinding);

                    if (wsdlOperationBinding.Input != null)
                    {
                        MarkSoapExtensionsAsHandled(wsdlOperationBinding.Input);
                    }

                    if (wsdlOperationBinding.Output != null)
                    {
                        MarkSoapExtensionsAsHandled(wsdlOperationBinding.Output);
                    }

                    foreach (WsdlNS.MessageBinding wsdlMessageBinding in wsdlOperationBinding.Faults)
                    {
                        MarkSoapExtensionsAsHandled(wsdlMessageBinding);
                    }
                }
            }

        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:32,代码来源:MessageContractImporter.cs


示例5:

 void IWsdlImportExtension.ImportEndpoint(WsdlImporter importer, WsdlEndpointConversionContext context)
 {
     if (context != null && context.WsdlBinding != null && ContainsHttpBindingExtension(context.WsdlBinding))
     {
         httpBindingContracts.Add(context.ContractConversionContext.Contract);
     }
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:HttpBindingExtension.cs


示例6: ExportEndpoint

 public void ExportEndpoint(
     WsdlExporter exporter,
     WsdlEndpointConversionContext context
     )
 {
    
 }
开发者ID:JonasSyrstad,项目名称:Stardust,代码行数:7,代码来源:InlineXsdInWsdlBehavior.cs


示例7: Exception

		void IWsdlImportExtension.ImportEndpoint(WsdlImporter importer,
			WsdlEndpointConversionContext context)
		{
			for (int i = 0; i < context.WsdlBinding.Extensions.Count; i ++) {
				if (context.WsdlBinding.Extensions [i] is SoapBinding) {
					SoapBinding transport = context.WsdlBinding.Extensions [i] as SoapBinding;
					if (transport.Transport != SoapBinding.HttpTransport)
						//FIXME: not http
						return;

					if (! (context.Endpoint.Binding is CustomBinding))
						//FIXME: 
						throw new Exception ();

					((CustomBinding) context.Endpoint.Binding).Elements.Add (new HttpTransportBindingElement ());
					//((CustomBinding) context.Endpoint.Binding).Scheme = "http";

					for (int j = 0; j < context.WsdlPort.Extensions.Count; j ++) {
						SoapAddressBinding address = context.WsdlPort.Extensions [j] as SoapAddressBinding;
						if (address == null)
							continue;

						context.Endpoint.Address = new EndpointAddress (address.Location);
						context.Endpoint.ListenUri = new Uri (address.Location);
					}

					break;
				}
			}
		}
开发者ID:nickchal,项目名称:pash,代码行数:30,代码来源:TransportBindingElementImporter.cs


示例8: ImportEndpoint

		public void ImportEndpoint (WsdlImporter importer, WsdlEndpointConversionContext context)
		{
			// Only import the binding, not the endpoint.
			if (context.WsdlPort == null)
				return;
			
			DoImportEndpoint (context);
		}
开发者ID:rabink,项目名称:mono,代码行数:8,代码来源:TransportBindingElementImporter.cs


示例9: DoImportEndpoint

		bool DoImportEndpoint (WsdlEndpointConversionContext context)
		{
			if (ImportBasicHttpEndpoint (context))
				return true;
			if (ImportNetTcpEndpoint (context))
				return true;
			return false;
		}
开发者ID:rabink,项目名称:mono,代码行数:8,代码来源:TransportBindingElementImporter.cs


示例10:

		void IWsdlImportExtension.ImportEndpoint (WsdlImporter importer,
			WsdlEndpointConversionContext context)
		{
			if (!Enabled)
				return;

			impl.ImportEndpoint (importer, context);
		}
开发者ID:nlhepler,项目名称:mono,代码行数:8,代码来源:DataContractSerializerMessageContractImporter.cs


示例11: CreateLegacyTransportBindingElement

 private static void CreateLegacyTransportBindingElement(WsdlImporter importer, SoapBinding soapBinding, WsdlEndpointConversionContext context)
 {
     TransportBindingElement item = CreateTransportBindingElements(soapBinding.Transport, null);
     if (item != null)
     {
         ConvertToCustomBinding(context).Elements.Add(item);
         StateHelper.RegisterTransportBindingElement(importer, context);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:TransportBindingElementImporter.cs


示例12: ConvertToCustomBinding

 static CustomBinding ConvertToCustomBinding(WsdlEndpointConversionContext context)
 {
     CustomBinding customBinding = context.Endpoint.Binding as CustomBinding;
     if (customBinding == null)
     {
         customBinding = new CustomBinding(context.Endpoint.Binding);
         context.Endpoint.Binding = customBinding;
     }
     return customBinding;
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:10,代码来源:TransportBindingElementImporter.cs


示例13: ConvertToCustomBinding

 private static CustomBinding ConvertToCustomBinding(WsdlEndpointConversionContext context)
 {
     CustomBinding binding = context.Endpoint.Binding as CustomBinding;
     if (binding == null)
     {
         binding = new CustomBinding(context.Endpoint.Binding);
         context.Endpoint.Binding = binding;
     }
     return binding;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:MessageEncodingBindingElementImporter.cs


示例14:

        void IWsdlExportExtension.ExportEndpoint(WsdlExporter exporter, WsdlEndpointConversionContext context)
        {
            if (SingleFile)
                SingleFileExporter.ExportEndpoint(exporter);

            if (Location != null)
            {
                LocationOverrideExporter.ExportEndpoint(exporter, context, Location);
            }
        }
开发者ID:anukat2015,项目名称:sones,代码行数:10,代码来源:WsdlExtensions.cs


示例15: if

        void IWsdlImportExtension.ImportEndpoint(WsdlImporter importer, WsdlEndpointConversionContext endpointContext)
        {
            if (endpointContext == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpointContext");

#pragma warning suppress 56506 // [....], endpointContext.Endpoint is never null
            if (endpointContext.Endpoint.Binding == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpointContext.Binding");

            if (endpointContext.Endpoint.Binding is CustomBinding)
            {
                BindingElementCollection elements = ((CustomBinding)endpointContext.Endpoint.Binding).Elements;

                Binding binding;
                TransportBindingElement transport = elements.Find<TransportBindingElement>();

                if (transport is HttpTransportBindingElement)
                {
                    if (WSHttpBindingBase.TryCreate(elements, out binding))
                    {
                        SetBinding(endpointContext.Endpoint, binding);
                    }
                    else if (WSDualHttpBinding.TryCreate(elements, out binding))
                    {
                        SetBinding(endpointContext.Endpoint, binding);
                    }
                    else if (BasicHttpBinding.TryCreate(elements, out binding))
                    {
                        SetBinding(endpointContext.Endpoint, binding);
                    }
                    else if (NetHttpBinding.TryCreate(elements, out binding))
                    {
                        SetBinding(endpointContext.Endpoint, binding);
                    }
                }
                else if (transport is MsmqTransportBindingElement && NetMsmqBinding.TryCreate(elements, out binding))
                {
                    SetBinding(endpointContext.Endpoint, binding);
                }
                else if (transport is NamedPipeTransportBindingElement && NetNamedPipeBinding.TryCreate(elements, out binding))
                {
                    SetBinding(endpointContext.Endpoint, binding);
                }
#pragma warning disable 0618				
                else if (transport is PeerTransportBindingElement && NetPeerTcpBinding.TryCreate(elements, out binding))
                {
                    SetBinding(endpointContext.Endpoint, binding);
                }
#pragma warning restore 0618				
                else if (transport is TcpTransportBindingElement && NetTcpBinding.TryCreate(elements, out binding))
                {
                    SetBinding(endpointContext.Endpoint, binding);
                }
            }
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:55,代码来源:StandardBindingImporter.cs


示例16: WsdlEndpointConversionContext

 internal WsdlEndpointConversionContext(WsdlEndpointConversionContext bindingContext, ServiceEndpoint endpoint, Port wsdlport)
 {
     this.endpoint = endpoint;
     this.wsdlBinding = bindingContext.WsdlBinding;
     this.wsdlPort = wsdlport;
     this.contractContext = bindingContext.contractContext;
     this.wsdlOperationBindings = bindingContext.wsdlOperationBindings;
     this.operationDescriptionBindings = bindingContext.operationDescriptionBindings;
     this.wsdlMessageBindings = bindingContext.wsdlMessageBindings;
     this.messageDescriptionBindings = bindingContext.messageDescriptionBindings;
     this.wsdlFaultBindings = bindingContext.wsdlFaultBindings;
     this.faultDescriptionBindings = bindingContext.faultDescriptionBindings;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:13,代码来源:WsdlEndpointConversionContext.cs


示例17: GetBindingElements

        void IWsdlImportExtension.ImportEndpoint(WsdlImporter importer, WsdlEndpointConversionContext context)
        {
            if (context == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
            }

#pragma warning suppress 56506 // [....], these properties cannot be null in this context
            if (context.Endpoint.Binding == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context.Endpoint.Binding");
            }

            BindingElementCollection bindingElements = GetBindingElements(context);
            MessageEncodingBindingElement messageEncodingBindingElement = bindingElements.Find<MessageEncodingBindingElement>();
            TextMessageEncodingBindingElement textEncodingBindingElement = messageEncodingBindingElement as TextMessageEncodingBindingElement;

            if (messageEncodingBindingElement != null)
            {
                Type elementType = messageEncodingBindingElement.GetType();
                if (elementType != typeof(TextMessageEncodingBindingElement)
                    && elementType != typeof(BinaryMessageEncodingBindingElement)
                    && elementType != typeof(MtomMessageEncodingBindingElement))
                    return;
            }

            EnsureMessageEncoding(context, messageEncodingBindingElement);

            foreach (OperationBinding wsdlOperationBinding in context.WsdlBinding.Operations)
            {
                OperationDescription operation = context.GetOperationDescription(wsdlOperationBinding);

                for (int i = 0; i < operation.Messages.Count; i++)
                {
                    MessageDescription message = operation.Messages[i];
                    MessageBinding wsdlMessageBinding = context.GetMessageBinding(message);
                    ImportMessageSoapAction(context.ContractConversionContext, message, wsdlMessageBinding, i != 0 /*isResponse*/);
                }

                foreach (FaultDescription fault in operation.Faults)
                {
                    FaultBinding wsdlFaultBinding = context.GetFaultBinding(fault);
                    if (wsdlFaultBinding != null)
                    {
                        ImportFaultSoapAction(context.ContractConversionContext, fault, wsdlFaultBinding);
                    }
                }
            }

        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:50,代码来源:MessageEncodingBindingElementImporter.cs


示例18: CallExtension

 private void CallExtension(WsdlEndpointConversionContext endpointContext, IWsdlExportExtension extension)
 {
     try
     {
         extension.ExportEndpoint(this, endpointContext);
     }
     catch (Exception exception)
     {
         if (Fx.IsFatal(exception))
         {
             throw;
         }
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(this.ThrowExtensionException(endpointContext.Endpoint, extension, exception));
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:WsdlExporter.cs


示例19: if

 void IWsdlImportExtension.ImportEndpoint(WsdlImporter importer, WsdlEndpointConversionContext endpointContext)
 {
     if (endpointContext == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpointContext");
     }
     if (endpointContext.Endpoint.Binding == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpointContext.Binding");
     }
     if (endpointContext.Endpoint.Binding is CustomBinding)
     {
         System.ServiceModel.Channels.Binding binding;
         BindingElementCollection elements = ((CustomBinding) endpointContext.Endpoint.Binding).Elements;
         TransportBindingElement element = elements.Find<TransportBindingElement>();
         if (element is HttpTransportBindingElement)
         {
             if (WSHttpBindingBase.TryCreate(elements, out binding))
             {
                 this.SetBinding(endpointContext.Endpoint, binding);
             }
             else if (WSDualHttpBinding.TryCreate(elements, out binding))
             {
                 this.SetBinding(endpointContext.Endpoint, binding);
             }
             else if (BasicHttpBinding.TryCreate(elements, out binding))
             {
                 this.SetBinding(endpointContext.Endpoint, binding);
             }
         }
         else if ((element is MsmqTransportBindingElement) && NetMsmqBinding.TryCreate(elements, out binding))
         {
             this.SetBinding(endpointContext.Endpoint, binding);
         }
         else if ((element is NamedPipeTransportBindingElement) && NetNamedPipeBinding.TryCreate(elements, out binding))
         {
             this.SetBinding(endpointContext.Endpoint, binding);
         }
         else if ((element is PeerTransportBindingElement) && NetPeerTcpBinding.TryCreate(elements, out binding))
         {
             this.SetBinding(endpointContext.Endpoint, binding);
         }
         else if ((element is TcpTransportBindingElement) && NetTcpBinding.TryCreate(elements, out binding))
         {
             this.SetBinding(endpointContext.Endpoint, binding);
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:48,代码来源:StandardBindingImporter.cs


示例20: ImportAddress

        static void ImportAddress(WsdlEndpointConversionContext context, TransportBindingElement transportBindingElement)
        {
            EndpointAddress address = context.Endpoint.Address = WsdlImporter.WSAddressingHelper.ImportAddress(context.WsdlPort);
            if (address != null)
            {
                context.Endpoint.Address = address;

                // Replace the http BE with https BE only if the uri scheme is https and the transport binding element is a HttpTransportBindingElement but not HttpsTransportBindingElement
                if (address.Uri.Scheme == Uri.UriSchemeHttps && transportBindingElement is HttpTransportBindingElement && !(transportBindingElement is HttpsTransportBindingElement))
                {
                    BindingElementCollection elements = ConvertToCustomBinding(context).Elements;
                    elements.Remove(transportBindingElement);
                    elements.Add(CreateHttpsFromHttp(transportBindingElement as HttpTransportBindingElement));
                }
            }
        }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:16,代码来源:TransportBindingElementImporter.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Description.WsdlExporter类代码示例发布时间:2022-05-26
下一篇:
C# Description.WsdlContractConversionContext类代码示例发布时间: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