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


C# Services.Description类代码示例

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


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

示例1: WsdlContractConversionContext

        internal WsdlContractConversionContext(ContractDescription contract, WsdlNS.PortType wsdlPortType)
        {

            this.contract = contract;
            this.wsdlPortType = wsdlPortType;

            this.wsdlOperations = new Dictionary<OperationDescription, WsdlNS.Operation>();
            this.operationDescriptions = new Dictionary<WsdlNS.Operation, OperationDescription>();
            this.wsdlOperationMessages = new Dictionary<MessageDescription, WsdlNS.OperationMessage>();
            this.messageDescriptions = new Dictionary<WsdlNS.OperationMessage, MessageDescription>();
            this.wsdlOperationFaults = new Dictionary<FaultDescription, WsdlNS.OperationFault>();
            this.faultDescriptions = new Dictionary<WsdlNS.OperationFault, FaultDescription>();
            this.operationBindings = new Dictionary<WsdlNS.Operation, Collection<WsdlNS.OperationBinding>>();
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:14,代码来源:WsdlContractConversionContext.cs

示例2: WsdlEndpointConversionContext

        internal WsdlEndpointConversionContext(WsdlEndpointConversionContext bindingContext, ServiceEndpoint endpoint, WsdlNS.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:iskiselev,项目名称:JSIL.NetFramework,代码行数:15,代码来源:WsdlEndpointConversionContext.cs

示例3: BeforeImport

 public void BeforeImport(WsdlNS.ServiceDescriptionCollection wsdlDocuments, Xml.Schema.XmlSchemaSet xmlSchemas, ICollection<Xml.XmlElement> policy)
 {
     foreach (WsdlNS.ServiceDescription wsdl in wsdlDocuments)
     {
         if (wsdl != null)
         {
             foreach (WsdlNS.Binding wsdlBinding in wsdl.Bindings)
             {
                 if (wsdlBinding != null && wsdlBinding.Extensions != null)
                 {
                     WsdlNS.SoapBinding soapBinding = (WsdlNS.SoapBinding)wsdlBinding.Extensions.Find(typeof(WsdlNS.SoapBinding));
                     if (soapBinding != null)
                     {
                         string transportUri = soapBinding.Transport;
                         if (!string.IsNullOrEmpty(transportUri) && transportUri.Equals(UdpConstants.WsdlSoapUdpTransportUri, StringComparison.Ordinal))
                         {
                             WsdlImporter.SoapInPolicyWorkaroundHelper.InsertAdHocPolicy(wsdlBinding, soapBinding.Transport, this.udpTransportUriKey);
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:24,代码来源:UdpTransportImporter.cs

示例4: AssertPolicy

		public static PolicyAssertionCollection AssertPolicy (
			WS.Binding binding, TestLabel label)
		{
			label.EnterScope ("FindPolicy");
			XmlElement policy = null;
		
			foreach (var extension in binding.Extensions) {
				var xml = extension as XmlElement;
				if (xml == null)
					continue;
				Assert.That (policy, Is.Null, label.Get ());
				policy = xml;
			}
			Assert.That (policy, Is.Not.Null, label.Get ());
			try {
				return AssertPolicy (binding.ServiceDescription, policy, label);
			} finally {
				label.LeaveScope ();
			}
		}
开发者ID:,项目名称:,代码行数:20,代码来源:

示例5: AddToMetadataIfNotNull

		void AddToMetadataIfNotNull(WSDescription.ServiceDescription serviceDescription)
		{
			if (serviceDescription != null) {
				AddMetadataSection(MetadataSection.ServiceDescriptionDialect, serviceDescription);
			}
		}
开发者ID:nylen,项目名称:SharpDevelop,代码行数:6,代码来源:WebServiceMetadataSet.cs

示例6: ExportMessageBodyBinding

            void ExportMessageBodyBinding(MessageDescription messageDescription, bool isRpc, bool isEncoded, WsdlNS.MessageBinding messageBinding)
            {
                WsdlNS.SoapBodyBinding bodyBinding = SoapHelper.GetOrCreateSoapBodyBinding(endpointContext, messageBinding, exporter);

                if (bodyBinding == null)
                    return;

                bodyBinding.Use = isEncoded ? WsdlNS.SoapBindingUse.Encoded : WsdlNS.SoapBindingUse.Literal;
                if (isRpc)
                {
                    string ns;
                    if (!ExportedMessages.WrapperNamespaces.TryGetValue(new MessageDescriptionDictionaryKey(endpointContext.ContractConversionContext.Contract, messageDescription), out ns))
                        ns = messageDescription.Body.WrapperNamespace;
                    bodyBinding.Namespace = ns;
                }
                if (isEncoded)
                    bodyBinding.Encoding = XmlSerializerOperationFormatter.GetEncoding(soapVersion);
            }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:18,代码来源:MessageContractExporter.cs

示例7: ExportMessagePart

        protected void ExportMessagePart(WsdlNS.Message message, MessagePartDescription part, XmlQualifiedName typeName, XmlSchemaType xsdType, bool isOptional, bool isNillable, bool skipSchemaExport, bool generateElement, string wrapperNs, XmlSchemaSequence wrapperSequence, XmlSchemaSet schemaSet)
        {
            if (IsNullOrEmpty(typeName) && xsdType == null)
                return;
#if DEBUG
            if (xsdType == null)
                Fx.Assert(NamingHelper.IsValidNCName(typeName.Name), "Name value has to be a valid NCName.");
#endif
            string elementName = part.Name;
            string partName = string.IsNullOrEmpty(part.UniquePartName) ? elementName : part.UniquePartName;

            WsdlNS.MessagePart wsdlPart = null;
            if (generateElement)
            {
                if (wrapperSequence != null)
                {
                    if (!skipSchemaExport)
                        ExportLocalElement(wrapperNs, partName, part.Namespace, typeName, xsdType, part.Multiple, isOptional, isNillable, wrapperSequence, schemaSet);
                }
                else
                {
                    if (!skipSchemaExport)
                        ExportGlobalElement(elementName, part.Namespace, isNillable, typeName, xsdType, schemaSet);
                    wsdlPart = AddMessagePart(message, partName, new XmlQualifiedName(elementName, part.Namespace), XmlQualifiedName.Empty);
                }
            }
            else
            {
                if (String.IsNullOrEmpty(typeName.Name))
                    throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.SFxAnonymousTypeNotSupported, message.Name, partName)));

                wsdlPart = AddMessagePart(message, partName, XmlQualifiedName.Empty, typeName);
            }
            if (wsdlPart != null)
            {
                part.UniquePartName = wsdlPart.Name;
            }
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:38,代码来源:MessageContractExporter.cs

示例8: CreateHeaderMessage

        protected bool CreateHeaderMessage(MessageDescription message, out WsdlNS.Message wsdlMessage)
        {
            wsdlMessage = null;

            if (ExportedMessages.WsdlHeaderMessages.ContainsKey(new MessageDescriptionDictionaryKey(contractContext.Contract, message)))
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(SR.GetString(SR.MultipleCallsToExportContractWithSameContract)));

            TypedMessageKey typedMessageKey = null;
            if (message.IsTypedMessage)
            {
                typedMessageKey = new TypedMessageKey(message.MessageType, operation.DeclaringContract.Namespace, GetExtensionData());
                if (ExportedMessages.TypedHeaderMessages.TryGetValue(typedMessageKey, out wsdlMessage))
                {
                    this.ExportedMessages.WsdlHeaderMessages.Add(new MessageDescriptionDictionaryKey(contractContext.Contract, message), wsdlMessage);
                    return false;
                }
            }

            string messageName = GetHeaderMessageName(message);
            wsdlMessage = new WsdlNS.Message();
            wsdlMessage.Name = messageName;
            contractContext.WsdlPortType.ServiceDescription.Messages.Add(wsdlMessage);
            if (message.IsTypedMessage)
                ExportedMessages.TypedHeaderMessages.Add(typedMessageKey, wsdlMessage);

            this.ExportedMessages.WsdlHeaderMessages.Add(new MessageDescriptionDictionaryKey(contractContext.Contract, message), wsdlMessage);

            return true;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:29,代码来源:MessageContractExporter.cs

示例9: GetUniqueMessageName

 string GetUniqueMessageName(WsdlNS.ServiceDescription wsdl, string messageNameBase)
 {
     return NamingHelper.GetUniqueName(messageNameBase, DoesMessageNameExist, wsdl);
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:4,代码来源:MessageContractExporter.cs

示例10: ExportAnyMessage

        void ExportAnyMessage(WsdlNS.Message message, MessagePartDescription part)
        {
            XmlSchemaSet schemas = this.exporter.GeneratedXmlSchemas;
            XmlSchema schema = SchemaHelper.GetSchema(DataContractSerializerMessageContractImporter.GenericMessageTypeName.Namespace, schemas);

            if (!schema.SchemaTypes.Contains(DataContractSerializerMessageContractImporter.GenericMessageTypeName))
            {
                XmlSchemaComplexType genericMessageType = new XmlSchemaComplexType();
                genericMessageType.Name = DataContractSerializerMessageContractImporter.GenericMessageTypeName.Name;
                XmlSchemaSequence bodySequence = new XmlSchemaSequence();
                genericMessageType.Particle = bodySequence;

                XmlSchemaAny anyElement = new XmlSchemaAny();
                anyElement.MinOccurs = 0;
                anyElement.MaxOccurs = decimal.MaxValue;
                anyElement.Namespace = "##any";

                bodySequence.Items.Add(anyElement);

                SchemaHelper.AddTypeToSchema(genericMessageType, schema, schemas);
            }
            string partName = string.IsNullOrEmpty(part.UniquePartName) ? part.Name : part.UniquePartName;
            WsdlNS.MessagePart wsdlPart = AddMessagePart(message, partName, XmlQualifiedName.Empty, DataContractSerializerMessageContractImporter.GenericMessageTypeName);
            part.UniquePartName = wsdlPart.Name;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:25,代码来源:MessageContractExporter.cs

示例11: ExportFaultBinding

 void ExportFaultBinding(FaultDescription fault, bool isEncoded, WsdlNS.OperationBinding operationBinding)
 {
     SoapHelper.CreateSoapFaultBinding(fault.Name, endpointContext, endpointContext.GetFaultBinding(fault), isEncoded);
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:4,代码来源:MessageContractExporter.cs

示例12: ExportStreamBody

 protected void ExportStreamBody(WsdlNS.Message message, string wrapperName, string wrapperNs, string partName, string partNs, bool isRpc, bool skipSchemaExport)
 {
     XmlSchemaSet schemas = this.exporter.GeneratedXmlSchemas;
     XmlSchema schema = SchemaHelper.GetSchema(DataContractSerializerMessageContractImporter.StreamBodyTypeName.Namespace, schemas);
     if (!schema.SchemaTypes.Contains(DataContractSerializerMessageContractImporter.StreamBodyTypeName))
     {
         XmlSchemaSimpleType streamBodyType = new XmlSchemaSimpleType();
         streamBodyType.Name = DataContractSerializerMessageContractImporter.StreamBodyTypeName.Name;
         XmlSchemaSimpleTypeRestriction contentRestriction = new XmlSchemaSimpleTypeRestriction();
         contentRestriction.BaseTypeName = XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Base64Binary).QualifiedName;
         streamBodyType.Content = contentRestriction;
         SchemaHelper.AddTypeToSchema(streamBodyType, schema, schemas);
     }
     XmlSchemaSequence wrapperSequence = null;
     if (!isRpc && wrapperName != null)
         wrapperSequence = ExportWrappedPart(message, wrapperName, wrapperNs, schemas, skipSchemaExport);
     MessagePartDescription streamPart = new MessagePartDescription(partName, partNs);
     ExportMessagePart(message, streamPart, DataContractSerializerMessageContractImporter.StreamBodyTypeName, null/*xsdType*/, false/*isOptional*/, false/*isNillable*/, skipSchemaExport, !isRpc, wrapperNs, wrapperSequence, schemas);
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:19,代码来源:MessageContractExporter.cs

示例13: ExportMessageHeaderBinding

            void ExportMessageHeaderBinding(MessageHeaderDescription header, XmlQualifiedName messageName, bool isEncoded, WsdlNS.MessageBinding messageBinding)
            {
#if DEBUG
                Fx.Assert(NamingHelper.IsValidNCName(messageName.Name), "Name value has to be a valid NCName.");
#endif
                WsdlNS.SoapHeaderBinding headerBinding = SoapHelper.CreateSoapHeaderBinding(endpointContext, messageBinding);
                headerBinding.Part = string.IsNullOrEmpty(header.UniquePartName) ? header.Name : header.UniquePartName;
                headerBinding.Message = messageName;
                headerBinding.Use = isEncoded ? WsdlNS.SoapBindingUse.Encoded : WsdlNS.SoapBindingUse.Literal;
                if (isEncoded)
                    headerBinding.Encoding = XmlSerializerOperationFormatter.GetEncoding(soapVersion);
            }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:12,代码来源:MessageContractExporter.cs

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

示例15: ContainsHttpBindingExtension

 static bool ContainsHttpBindingExtension(WsdlNS.Binding wsdlBinding)
 {
     //avoiding using wsdlBinding.Extensions.Find(typeof(WsdlNS.HttpBinding)) so the extension won't be marked as handled
     foreach (object extension in wsdlBinding.Extensions)
     {
         if (extension is WsdlNS.HttpBinding)
         {
             string httpVerb = ((WsdlNS.HttpBinding)extension).Verb;
             if (httpVerb.Equals("GET", StringComparison.OrdinalIgnoreCase) || httpVerb.Equals("POST", StringComparison.OrdinalIgnoreCase))
             {
                 return true;
             }
         }
     }
     return false;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:16,代码来源:HttpBindingExtension.cs


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