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


C# WsdlImporter.ImportEndpoints方法代码示例

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


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

示例1: ImportEndpoints

 private static ServiceEndpointCollection ImportEndpoints(MetadataSet metadataSet, IEnumerable<ContractDescription> contracts, MetadataExchangeClient client)
 {
     ServiceEndpointCollection endpoints = new ServiceEndpointCollection();
     WsdlImporter importer = new WsdlImporter(metadataSet);
     importer.State.Add("MetadataExchangeClientKey", client);
     foreach (ContractDescription description in contracts)
     {
         importer.KnownContracts.Add(WsdlExporter.WsdlNamingHelper.GetPortTypeQName(description), description);
     }
     foreach (ContractDescription description2 in contracts)
     {
         foreach (ServiceEndpoint endpoint in importer.ImportEndpoints(description2))
         {
             endpoints.Add(endpoint);
         }
     }
     if (importer.Errors.Count > 0)
     {
         TraceWsdlImportErrors(importer);
     }
     return endpoints;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:22,代码来源:MetadataResolver.cs

示例2: ImportWsdlPortType

 ServiceEndpointCollection ImportWsdlPortType(XmlQualifiedName portTypeQName, WsdlImporter importer)
 {
     foreach (WsdlNS.ServiceDescription wsdl in importer.WsdlDocuments)
     {
         if (wsdl.TargetNamespace == portTypeQName.Namespace)
         {
             WsdlNS.PortType wsdlPortType = wsdl.PortTypes[portTypeQName.Name];
             if (wsdlPortType != null)
             {
                 ServiceEndpointCollection endpoints = importer.ImportEndpoints(wsdlPortType);
                 return endpoints;
             }
         }
     }
     return new ServiceEndpointCollection();
 }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:16,代码来源:MexServiceChannelBuilder.cs

示例3: ImportEndpoints

        private static ServiceEndpointCollection ImportEndpoints(MetadataSet metadataSet, IEnumerable<ContractDescription> contracts, MetadataExchangeClient client)
        {
            ServiceEndpointCollection endpoints = new ServiceEndpointCollection();

            WsdlImporter importer = new WsdlImporter(metadataSet);

            // remember the original proxy so user doesn't need to set it again 
            importer.State.Add(MetadataExchangeClient.MetadataExchangeClientKey, client);

            foreach (ContractDescription cd in contracts)
            {
                importer.KnownContracts.Add(WsdlExporter.WsdlNamingHelper.GetPortTypeQName(cd), cd);
            }

            foreach (ContractDescription cd in contracts)
            {
                ServiceEndpointCollection contractEndpoints;
                contractEndpoints = importer.ImportEndpoints(cd);
                foreach (ServiceEndpoint se in contractEndpoints)
                {
                    endpoints.Add(se);
                }
            }

            //Trace all warnings and errors
            if (importer.Errors.Count > 0)
            {
                TraceWsdlImportErrors(importer);
            }

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

示例4: ImportWsdlPortType

 private ServiceEndpointCollection ImportWsdlPortType(XmlQualifiedName portTypeQName, WsdlImporter importer)
 {
     foreach (System.Web.Services.Description.ServiceDescription description in importer.WsdlDocuments)
     {
         if (description.TargetNamespace == portTypeQName.Namespace)
         {
             PortType wsdlPortType = description.PortTypes[portTypeQName.Name];
             if (wsdlPortType != null)
             {
                 return importer.ImportEndpoints(wsdlPortType);
             }
         }
     }
     return new ServiceEndpointCollection();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:MexServiceChannelBuilder.cs

示例5: BasicHttpBinding_ImportEndpoints

		public void BasicHttpBinding_ImportEndpoints ()
		{
			var label = new TestLabel ("BasicHttpBinding_ImportEndpoints");
			
			var doc = TestContext.LoadMetadata ("BasicHttp");
			var sd = (WS.ServiceDescription)doc.MetadataSections [0].Metadata;
			
			label.EnterScope ("wsdl");
			Assert.That (sd.Bindings, Is.Not.Null, label.Get ());
			Assert.That (sd.Bindings.Count, Is.EqualTo (1), label.Get ());
			var binding = sd.Bindings [0];
			
			Assert.That (sd.Services, Is.Not.Null, label.Get ());
			Assert.That (sd.Services.Count, Is.EqualTo (1), label.Get ());
			var service = sd.Services [0];
			
			Assert.That (service.Ports, Is.Not.Null, label.Get ());
			Assert.That (service.Ports.Count, Is.EqualTo (1), label.Get ());
			var port = service.Ports [0];
			
			Assert.That (sd.PortTypes, Is.Not.Null, label.Get ());
			Assert.That (sd.PortTypes.Count, Is.EqualTo (1), label.Get ());
			var portType = sd.PortTypes [0];
			
			label.LeaveScope ();
			
			var importer = new WsdlImporter (doc);
			
			label.EnterScope ("by-service");
			var byService = importer.ImportEndpoints (service);
			BindingTestAssertions.CheckImportErrors (importer, label);
			Assert.That (byService, Is.Not.Null, label.Get ());
			Assert.That (byService.Count, Is.EqualTo (1), label.Get ());
			label.LeaveScope ();
			
			label.EnterScope ("by-binding");
			var byBinding = importer.ImportEndpoints (binding);
			BindingTestAssertions.CheckImportErrors (importer, label);
			Assert.That (byBinding, Is.Not.Null, label.Get ());
			Assert.That (byBinding.Count, Is.EqualTo (1), label.Get ());
			label.LeaveScope ();
			
			label.EnterScope ("by-port-type");
			var byPortType = importer.ImportEndpoints (portType);
			BindingTestAssertions.CheckImportErrors (importer, label);
			Assert.That (byPortType, Is.Not.Null, label.Get ());
			Assert.That (byPortType.Count, Is.EqualTo (1), label.Get ());
			label.LeaveScope ();
		}
开发者ID:nlhepler,项目名称:mono,代码行数:49,代码来源:MiscImportTests.cs


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