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


C# WsdlEndpointConversionContext.GetOperationDescription方法代碼示例

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


在下文中一共展示了WsdlEndpointConversionContext.GetOperationDescription方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

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

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

示例3: GetBindingElements

 void IWsdlImportExtension.ImportEndpoint(WsdlImporter importer, WsdlEndpointConversionContext context)
 {
     if (context == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context");
     }
     if (context.Endpoint.Binding == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context.Endpoint.Binding");
     }
     MessageEncodingBindingElement encodingBindingElement = GetBindingElements(context).Find<MessageEncodingBindingElement>();
     if (encodingBindingElement != null)
     {
         System.Type type = encodingBindingElement.GetType();
         if (((type != typeof(TextMessageEncodingBindingElement)) && (type != typeof(BinaryMessageEncodingBindingElement))) && (type != typeof(MtomMessageEncodingBindingElement)))
         {
             return;
         }
     }
     EnsureMessageEncoding(context, encodingBindingElement);
     foreach (OperationBinding binding in context.WsdlBinding.Operations)
     {
         OperationDescription operationDescription = context.GetOperationDescription(binding);
         for (int i = 0; i < operationDescription.Messages.Count; i++)
         {
             MessageDescription message = operationDescription.Messages[i];
             MessageBinding messageBinding = context.GetMessageBinding(message);
             ImportMessageSoapAction(context.ContractConversionContext, message, messageBinding, i != 0);
         }
         foreach (FaultDescription description3 in operationDescription.Faults)
         {
             FaultBinding faultBinding = context.GetFaultBinding(description3);
             if (faultBinding != null)
             {
                 ImportFaultSoapAction(context.ContractConversionContext, description3, faultBinding);
             }
         }
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:39,代碼來源:MessageEncodingBindingElementImporter.cs


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