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


C# WsdlExporter.ExportEndpoints方法代码示例

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


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

示例1: WsdlExporter

        void IServiceBehavior.ApplyDispatchBehavior(ServiceDescription serviceDescription,
            ServiceHostBase serviceHostBase)
        {
            WsdlExporter wsdlExporter = new WsdlExporter();
            wsdlExporter.ExportEndpoints(serviceDescription.Endpoints,
                new XmlQualifiedName(serviceDescription.Name, serviceDescription.Namespace));

            foreach (ChannelDispatcher cDispatcher in serviceHostBase.ChannelDispatchers)
                foreach (EndpointDispatcher endpointDispatcher in cDispatcher.Endpoints)
                    endpointDispatcher.DispatchRuntime.MessageInspectors.Add(
                        new XsdValidationInspector(wsdlExporter.GeneratedXmlSchemas));
        }
开发者ID:ssickles,项目名称:archive,代码行数:12,代码来源:XsdValidation.cs

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

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

示例4: Main

 static void Main(string[] args)
 {
     ContractDescription contract = ContractDescription.GetContract(typeof(IOrderService));
     EndpointAddress address1 = new EndpointAddress("http://127.0.0.1/orderservice");
     EndpointAddress address2 = new EndpointAddress("net.tcp://127.0.0.1/orderservice");
     ServiceEndpoint endpoint1 = new ServiceEndpoint(contract, new WS2007HttpBinding(), address1);
     ServiceEndpoint endpoint2 = new ServiceEndpoint(contract, new NetTcpBinding(), address2);
     XmlQualifiedName serviceName = new XmlQualifiedName("OrderService", "http://www.artech.com/services/");
     WsdlExporter exporter = new WsdlExporter();
     exporter.ExportEndpoints(new ServiceEndpoint[] { endpoint1, endpoint2 }, serviceName);
     MetadataSet metadata = exporter.GetGeneratedMetadata();
     using (XmlWriter writer = new XmlTextWriter("metadata.xml", Encoding.UTF8))
     {
         metadata.WriteTo(writer);
     }
     Process.Start("metadata.xml");
 }
开发者ID:huoxudong125,项目名称:WCF-Demo,代码行数:17,代码来源:Program.cs

示例5: GetExportedMetadata

 private static MetadataSet GetExportedMetadata(ServiceDescription serviceDescription)
 {
     Collection<ServiceEndpoint> endpoints = new Collection<ServiceEndpoint>();
     foreach (var endpoint in serviceDescription.Endpoints)
     {
         if (endpoint.Contract.ContractType == typeof(IMetadataProvisionService))
         {
             continue;
         }
         ServiceEndpoint newEndpoint = new ServiceEndpoint(endpoint.Contract, endpoint.Binding, endpoint.Address);
         newEndpoint.Name = endpoint.Name;
         foreach (var behavior in endpoint.Behaviors)
         {
             newEndpoint.Behaviors.Add(behavior);
         }
         endpoints.Add(newEndpoint);
     }
     WsdlExporter exporter = new WsdlExporter();
     XmlQualifiedName wsdlServiceQName = new XmlQualifiedName(serviceDescription.Name, serviceDescription.Namespace);
     exporter.ExportEndpoints(endpoints, wsdlServiceQName);
     MetadataSet metadata = exporter.GetGeneratedMetadata();
     return metadata;
 }
开发者ID:huoxudong125,项目名称:WCF-Demo,代码行数:23,代码来源:ServiceMetadataBehaviorAttribute.cs


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