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


C# Description.WsdlContractConversionContext类代码示例

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


WsdlContractConversionContext类属于System.ServiceModel.Description命名空间,在下文中一共展示了WsdlContractConversionContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: foreach

    /// <summary>
    /// When ExportContract is called to generate the necessary metadata, we inspect the service
    /// contract and build a list of parameters that we'll need to adjust the XSD for later.
    /// </summary>
    void IWsdlExportExtension.ExportContract(WsdlExporter exporter, WsdlContractConversionContext context)
    {
        _requiredParameter = new List<RequiredMessagePart>();

        foreach (var operation in context.Contract.Operations)
        {
            var inputMessage = operation.Messages.Where(m => m.Direction == MessageDirection.Input).First();
            var parameters = operation.SyncMethod.GetParameters();
            Debug.Assert(parameters.Length == inputMessage.Body.Parts.Count);

            for (int i = 0; i < parameters.Length; i++)
            {
                object[] attributes = parameters[i].GetCustomAttributes(typeof(OptionalAttribute), false);
                if (attributes.Length == 0)
                {
                    // The parameter has no [Optional] attribute, add it to the list of parameters
                    // that we need to adjust the XML schema for later on.
                    _requiredParameter.Add(new RequiredMessagePart()
                    {
                        Namespace = inputMessage.Body.Parts[i].Namespace,
                        Message = operation.Name,
                        Name = inputMessage.Body.Parts[i].Name
                    });
                }
            }
        }
    }
开发者ID:mtazva,项目名称:Snippets,代码行数:31,代码来源:RequiredParametersBehaviorAttribute.cs

示例3: CallExportContract

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

示例4: ArgumentNullException

        void IWsdlImportExtension.ImportContract(WsdlImporter importer, WsdlContractConversionContext contractContext)
        {
            if (contractContext == null)
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("contractContext"));

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

示例5: ArgumentNullException

		void IWsdlImportExtension.ImportContract (WsdlImporter importer,
			WsdlContractConversionContext context)
		{
			if (!enabled)
				return;

			if (importer == null)
				throw new ArgumentNullException ("importer");
			if (context == null)
				throw new ArgumentNullException ("context");
			if (this.importer != null || this.context != null)
				throw new SystemException ("INTERNAL ERROR: unexpected recursion of ImportContract method call");

			dc_importer = new XsdDataContractImporter ();
			schema_set_in_use = new XmlSchemaSet ();
			schema_set_in_use.Add (importer.XmlSchemas);
			foreach (WSDL wsdl in importer.WsdlDocuments)
				foreach (XmlSchema xs in wsdl.Types.Schemas)
					schema_set_in_use.Add (xs);

			// commenting out this import operation, but might be required (I guess not).
			//dc_importer.Import (schema_set_in_use);
			schema_set_in_use.Compile ();

			this.importer = importer;
			this.context = context;
			try {
				DoImportContract ();
			} finally {
				this.importer = null;
				this.context = null;
			}
		}
开发者ID:nickchal,项目名称:pash,代码行数:33,代码来源:DataContractSerializerMessageContractImporter.cs

示例6: ExportContract

 //
 // IWsdlExportExtension Implementation
 //
 public void ExportContract(
     WsdlExporter exporter,
     WsdlContractConversionContext context
     )
 {
     // never called
 }
开发者ID:JonasSyrstad,项目名称:Stardust,代码行数:10,代码来源:InlineXsdInWsdlBehavior.cs

示例7: ArgumentNullException

		void IWsdlImportExtension.ImportContract (WsdlImporter importer,
			WsdlContractConversionContext context)
		{
			if (!enabled)
				return;

			if (importer == null)
				throw new ArgumentNullException ("importer");
			if (context == null)
				throw new ArgumentNullException ("context");
			if (this.importer != null || this.context != null)
				throw new SystemException ("INTERNAL ERROR: unexpected recursion of ImportContract method call");

#if USE_DATA_CONTRACT_IMPORTER
			dc_importer = new XsdDataContractImporter ();
			schema_set_in_use = new XmlSchemaSet ();
			schema_set_in_use.Add (importer.XmlSchemas);
			foreach (WSDL wsdl in importer.WsdlDocuments)
				foreach (XmlSchema xs in wsdl.Types.Schemas)
					schema_set_in_use.Add (xs);
			dc_importer.Import (schema_set_in_use);
#endif

			this.importer = importer;
			this.context = context;
			try {
				DoImportContract ();
			} finally {
				this.importer = null;
				this.context = null;
			}
		}
开发者ID:stabbylambda,项目名称:mono,代码行数:32,代码来源:DataContractSerializerMessageContractImporter.cs

示例8: MessageContractExporter

 protected MessageContractExporter(WsdlExporter exporter, WsdlContractConversionContext context, OperationDescription operation, IOperationBehavior extension)
 {
     this.exporter = exporter;
     this.contractContext = context;
     this.operation = operation;
     this.extension = extension;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:7,代码来源:MessageContractExporter.cs

示例9:

		void IWsdlImportExtension.ImportContract (WsdlImporter importer,
			WsdlContractConversionContext context)
		{
			if (!Enabled)
				return;

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

示例10: ImportContract

        /// <summary>Called when importing a contract.</summary>
        /// <param name="importer">The importer.</param>
        /// <param name="context">The import context to be modified.</param>
        public void ImportContract(WsdlImporter importer, WsdlContractConversionContext context)
        {
            // Ensure that the client class has been appropriately created in order for us to add methods to it.
            context.Contract.Behaviors.Add(new TaskAsyncServiceContractGenerationExtension());

            // For each operation, add a task-based async equivalent.
            foreach (Operation operation in context.WsdlPortType.Operations)
            {
                var description = context.Contract.Operations.Find(operation.Name);
                if (description != null)
                    description.Behaviors.Add(new TaskAsyncOperationContractGenerationExtension());
            }
        }
开发者ID:StephenCleary,项目名称:AsyncCTPUtil,代码行数:16,代码来源:TaskAsyncWsdlImportExtension.cs

示例11: CallExtension

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

示例12: GetDocumentation

        void IWsdlImportExtension.ImportContract(WsdlImporter importer, WsdlContractConversionContext context)
        {
            string documentation = GetDocumentation(context.WsdlPortType);
            context.Contract.Behaviors.Add(new XmlCommentsSvcExtension(this, documentation));

            foreach (Operation operation in context.WsdlPortType.Operations)
            {
                documentation = GetDocumentation(operation);
                if (!String.IsNullOrEmpty(documentation))
                {
                    OperationDescription operationDescription = context.Contract.Operations.Find(operation.Name);
                    operationDescription.Behaviors.Add(new XmlCommentsOpExtension(this, documentation));
                }
            }
        }
开发者ID:anukat2015,项目名称:sones,代码行数:15,代码来源:XmlCommentsImporter.cs

示例13:

 void IWsdlExportExtension.ExportContract(WsdlExporter exporter, WsdlContractConversionContext context)
 {
     // This is either for a service contract or operation, so set documentation accordingly.
     if (_contractDescription != null)
     {
         // Attribute was applied to a contract.
         context.WsdlPortType.Documentation = this.Text;
     }
     else
     {
         // Attribute was applied to an operation.
         Operation operation = context.GetOperation(_operationDescription);
         if (operation != null)
         {
             operation.Documentation = this.Text;
         }
     }
 }
开发者ID:dsiderova,项目名称:SiLADemoProviderWCF,代码行数:18,代码来源:WsdlDocumentationAttribute.cs

示例14: ImportFaultSoapAction

        static void ImportFaultSoapAction(WsdlContractConversionContext contractContext, FaultDescription fault, FaultBinding wsdlFaultBinding)
        {
            string soapAction = SoapHelper.ReadSoapAction(wsdlFaultBinding.OperationBinding);

            if (contractContext != null)
            {
                OperationFault wsdlOperationFault = contractContext.GetOperationFault(fault);
                string wsaAction = WsdlImporter.WSAddressingHelper.FindWsaActionAttribute(wsdlOperationFault);
                if (wsaAction == null && soapAction != null)
                    fault.Action = soapAction;
                //

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

示例15: ExportContract

        public void ExportContract(WsdlExporter exporter, WsdlContractConversionContext context)
        {
            XsdDataContractExporter xsdInventoryExporter;
            object dataContractExporter;
            if (!exporter.State.TryGetValue(typeof(XsdDataContractExporter), out dataContractExporter))
            {
                xsdInventoryExporter = new XsdDataContractExporter(exporter.GeneratedXmlSchemas);
                exporter.State.Add(typeof(XsdDataContractExporter), xsdInventoryExporter);
            }
            else
            {
                xsdInventoryExporter = (XsdDataContractExporter)dataContractExporter;
            }

            if (xsdInventoryExporter.Options == null)
            {
                xsdInventoryExporter.Options = new ExportOptions();
            }

            xsdInventoryExporter.Options.DataContractSurrogate = this.surrogate;
        }
开发者ID:OpenRIAServices,项目名称:OpenRiaServices,代码行数:21,代码来源:DomainServiceWsdlExportExtension.cs


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