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


C# Description.WsdlExporter类代码示例

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


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

示例1: ExportEndpointTest

		public void ExportEndpointTest ()
		{
			WsdlExporter we = new WsdlExporter ();

			ServiceEndpoint se = new ServiceEndpoint (ContractDescription.GetContract (typeof (IEchoService)));
			se.Binding = new BasicHttpBinding ();
			se.Address = new EndpointAddress ("http://localhost:8080");
			//TEST Invalid name: 5se.Name = "Service#1";
			//se.Name = "Service0";
			//se.ListenUri = new Uri ("http://localhost:8080/svc");

			we.ExportEndpoint (se);

			MetadataSet ms = we.GetGeneratedMetadata ();
			Assert.AreEqual (6, ms.MetadataSections.Count);
			CheckContract_IEchoService (ms, "#eet01");

			WSServiceDescription sd = GetServiceDescription (ms, "http://tempuri.org/", "ExportEndpointTest");
			CheckServicePort (GetService (sd, "service", "ExportEndpointTest"),
				"BasicHttpBinding_IEchoService", new XmlQualifiedName ("BasicHttpBinding_IEchoService", "http://tempuri.org/"),
				"http://localhost:8080/", "#eet02");

			CheckBasicHttpBinding (sd, "BasicHttpBinding_IEchoService", new XmlQualifiedName ("IEchoService", "http://myns/echo"),
				"Echo", "http://myns/echo/IEchoService/Echo", true, true, "#eet03");
		}
开发者ID:nlhepler,项目名称:mono,代码行数:25,代码来源:WsdlExporterTest.cs

示例2: WsdlExporter

 void IEndpointBehavior.ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
 {
     WsdlExporter wsdlExporter = new WsdlExporter();
     wsdlExporter.ExportEndpoint(endpoint);
     endpointDispatcher.DispatchRuntime.MessageInspectors.Add(
         new XsdValidationInspector(wsdlExporter.GeneratedXmlSchemas));
 }
开发者ID:ssickles,项目名称:archive,代码行数:7,代码来源:XsdValidation.cs

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

示例4: ExportEndpoints

        private XmlDocument ExportEndpoints()
        {
            WsdlExporter exporter = new WsdlExporter();
            foreach (ServiceEndpoint ep in endpoints)
            {
                exporter.ExportEndpoint(ep);
            }

            MetadataSet metadataSet = exporter.GetGeneratedMetadata();
            StringBuilder b = new StringBuilder();
            StringWriter sw = new StringWriter(b);
            XmlTextWriter tw = new XmlTextWriter(sw);
            foreach (MetadataSection section in metadataSet.MetadataSections)
            {
                if (section.Metadata is System.Web.Services.Description.ServiceDescription)
                {
                    System.Web.Services.Description.ServiceDescription sd = (System.Web.Services.Description.ServiceDescription)section.Metadata;
                    sd.Write(tw);
                }
            }

            string wcfWsdl = b.ToString();
            // Read it in to an XmlDocument.
            XmlDocument wcfWsdlDoc = new XmlDocument();
            wcfWsdlDoc.LoadXml(wcfWsdl);
            return wcfWsdlDoc;
        }
开发者ID:gtri-iead,项目名称:LEXS-NET-Sample-Implementation-3.1.4,代码行数:27,代码来源:WsdlWorkshop.cs

示例5: ExportEndpoint

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

示例6: ExportContract

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

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

示例8:

        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

示例9: GetMessageExportContext

 static MessageExportContext GetMessageExportContext(WsdlExporter exporter)
 {
     object messageExportContext;
     if (!exporter.State.TryGetValue(typeof(MessageExportContext), out messageExportContext))
     {
         messageExportContext = new MessageExportContext();
         exporter.State[typeof(MessageExportContext)] = messageExportContext;
     }
     return (MessageExportContext)messageExportContext;
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:10,代码来源:MessageContractExporter.cs

示例10: BasicHttp

		public static MetadataSet BasicHttp ()
		{
			var exporter = new WsdlExporter ();
			
			var cd = new ContractDescription ("MyContract");
			
			exporter.ExportEndpoint (new ServiceEndpoint (
				cd, new BasicHttpBinding (), new EndpointAddress (HttpUri)));
			
			return exporter.GetGeneratedMetadata ();
		}
开发者ID:ItsVeryWindy,项目名称:mono,代码行数:11,代码来源:MetadataSamples.cs

示例11: Ctor1

		public void Ctor1 ()
		{
			WsdlExporter we = new WsdlExporter ();

			Assert.IsNotNull (we.GetGeneratedMetadata ());
			Assert.IsNotNull (we.GeneratedWsdlDocuments, "#c1");
			Assert.AreEqual (0, we.GeneratedWsdlDocuments.Count, "#c2");

			Assert.IsNotNull (we.GeneratedXmlSchemas, "#c3");
			Assert.AreEqual (0, we.GeneratedXmlSchemas.Count, "#c4");
		}
开发者ID:nlhepler,项目名称:mono,代码行数:11,代码来源:WsdlExporterTest.cs

示例12: Generate

 public static Wsdl Generate(Type contract)
 {
     var exporter = new WsdlExporter();
     exporter.ExportContract(ContractDescription.GetContract(contract));
     var metadataSet = exporter.GetGeneratedMetadata();
     var schemaStream = new MemoryStream();
     metadataSet.WriteTo(new XmlTextWriter(new StreamWriter(schemaStream)));
     schemaStream.Position = 0;
     var source = XDocument.Load(
         new XmlTextReader(schemaStream));
     return new Wsdl(source);
 }
开发者ID:huoxudong125,项目名称:WCFDoc,代码行数:12,代码来源:Wsdl.cs

示例13: Trace

 public static void Trace(TraceEventType type, int traceCode, string description, ServiceInfo info, System.ServiceModel.Description.ServiceDescription service)
 {
     if (DiagnosticUtility.ShouldTrace(type))
     {
         WsdlExporter exporter = new WsdlExporter();
         string ns = "http://tempuri.org/";
         XmlQualifiedName wsdlServiceQName = new XmlQualifiedName("comPlusService", ns);
         exporter.ExportEndpoints(service.Endpoints, wsdlServiceQName);
         System.Web.Services.Description.ServiceDescription wsdl = exporter.GeneratedWsdlDocuments[ns];
         ComPlusServiceHostStartedServiceDetailsSchema schema = new ComPlusServiceHostStartedServiceDetailsSchema(info.AppID, info.Clsid, wsdl);
         TraceUtility.TraceEvent(type, traceCode, System.ServiceModel.SR.GetString(description), (TraceRecord) schema);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:13,代码来源:ComPlusServiceHostTrace.cs

示例14: BasicHttp_TransportSecurity

		public static MetadataSet BasicHttp_TransportSecurity ()
		{
			var exporter = new WsdlExporter ();
			
			var cd = new ContractDescription ("MyContract");
			
			var binding = new BasicHttpBinding ();
			binding.Security.Mode = BasicHttpSecurityMode.Transport;
			
			exporter.ExportEndpoint (new ServiceEndpoint (
				cd, binding, new EndpointAddress (HttpUri)));
			
			return exporter.GetGeneratedMetadata ();
		}
开发者ID:ItsVeryWindy,项目名称:mono,代码行数:14,代码来源:MetadataSamples.cs

示例15: Trace

 public static void Trace(TraceEventType type, int traceCode, string description, ServiceInfo info, ServiceDescription service)
 {
     if (DiagnosticUtility.ShouldTrace(type))
     {
         WsdlExporter exporter = new WsdlExporter();
         string serviceNs = NamingHelper.DefaultNamespace;
         XmlQualifiedName serviceQName = new XmlQualifiedName("comPlusService", serviceNs);
         exporter.ExportEndpoints(service.Endpoints, serviceQName);
         WsdlNS.ServiceDescription wsdl = exporter.GeneratedWsdlDocuments[serviceNs];
         ComPlusServiceHostStartedServiceDetailsSchema record =
             new ComPlusServiceHostStartedServiceDetailsSchema(info.AppID, info.Clsid, wsdl);
         TraceUtility.TraceEvent(type, traceCode, ServiceModelSR.GetString(description), record);
     }
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:14,代码来源:ComPlusDiagnosticTraceRecords.cs


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