當前位置: 首頁>>代碼示例>>C#>>正文


C# Description.WsdlEndpointConversionContext類代碼示例

本文整理匯總了C#中System.ServiceModel.Description.WsdlEndpointConversionContext的典型用法代碼示例。如果您正苦於以下問題:C# WsdlEndpointConversionContext類的具體用法?C# WsdlEndpointConversionContext怎麽用?C# WsdlEndpointConversionContext使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


WsdlEndpointConversionContext類屬於System.ServiceModel.Description命名空間,在下文中一共展示了WsdlEndpointConversionContext類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的System.ServiceModel.Description.WsdlEndpointConversionContext類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。