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


C# WsdlExporter.ExportEndpoint方法代码示例

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


在下文中一共展示了WsdlExporter.ExportEndpoint方法的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: 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

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

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

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

示例6: BasicHttp_MessageSecurity

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

示例7: SimpleExport

		public void SimpleExport ()
		{
			var label = new TestLabel ("DuplicateContract");
			
			var cd = new ContractDescription ("MyContract");
			var endpoint = new ServiceEndpoint (
				cd, new BasicHttpBinding (), new EndpointAddress (HttpUri));
			
			var exporter = new WsdlExporter ();
			exporter.ExportContract (cd);
			exporter.ExportEndpoint (endpoint);
			
			CheckExport (
				exporter, new QName ("MyContract", "http://tempuri.org/"),
				"BasicHttpBinding", 1, label);
		}
开发者ID:nlhepler,项目名称:mono,代码行数:16,代码来源:ExportTests.cs

示例8: ExportEndpointTest5

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

			ServiceEndpoint se = new ServiceEndpoint (ContractDescription.GetContract (typeof (IEchoService)));
			se.Binding = new BasicHttpBinding ();
			se.Address = new EndpointAddress ("http://localhost:8080");

			we.ExportEndpoint (se);

			MetadataSet ms = we.GetGeneratedMetadata ();
			Assert.AreEqual (6, ms.MetadataSections.Count);
			WSServiceDescription wsd = GetServiceDescription (ms, "http://tempuri.org/", "ExportEndpointTest5#1");

			SoapBinding soapBinding = (SoapBinding) wsd.Bindings [0].Extensions [0];
			Assert.AreEqual (SoapBindingStyle.Document, soapBinding.Style, "soapBinding.Style");
			Assert.AreEqual (SoapBinding.HttpTransport, soapBinding.Transport, "soapBinding.Transport");
		}
开发者ID:nlhepler,项目名称:mono,代码行数:17,代码来源:WsdlExporterTest.cs

示例9: NetTcp_TransferMode

		public static MetadataSet NetTcp_TransferMode ()
		{
			var exporter = new WsdlExporter ();
			
			var cd = new ContractDescription ("MyContract");
			
			var binding = new NetTcpBinding (SecurityMode.None, false);
			binding.TransferMode = TransferMode.Streamed;

			exporter.ExportEndpoint (new ServiceEndpoint (
				cd, binding, new EndpointAddress (NetTcpUri)));
			
			var doc = exporter.GetGeneratedMetadata ();
			return doc;
		}
开发者ID:vernon016,项目名称:mono,代码行数:15,代码来源:MetadataSamples.cs

示例10: NetTcp_ReliableSession

		public static MetadataSet NetTcp_ReliableSession ()
		{
			var exporter = new WsdlExporter ();
			
			var cd = new ContractDescription ("MyContract");
			
			var binding = new NetTcpBinding (SecurityMode.None, true);
			
			exporter.ExportEndpoint (new ServiceEndpoint (
				cd, binding, new EndpointAddress (NetTcpUri)));
			
			var doc = exporter.GetGeneratedMetadata ();
			return doc;
		}
开发者ID:vernon016,项目名称:mono,代码行数:14,代码来源:MetadataSamples.cs

示例11: NetTcp_TransportWithMessageCredential

		public static MetadataSet NetTcp_TransportWithMessageCredential ()
		{
			var exporter = new WsdlExporter ();
			
			var cd = new ContractDescription ("MyContract");
			
			exporter.ExportEndpoint (new ServiceEndpoint (
				cd, new NetTcpBinding (SecurityMode.TransportWithMessageCredential, false),
				new EndpointAddress (NetTcpUri)));
			
			var doc = exporter.GetGeneratedMetadata ();
			return doc;
		}
开发者ID:vernon016,项目名称:mono,代码行数:13,代码来源:MetadataSamples.cs

示例12: BasicHttps_TransportWithMessageCredential

		public static MetadataSet BasicHttps_TransportWithMessageCredential ()
		{
			var exporter = new WsdlExporter ();
			
			var cd = new ContractDescription ("MyContract");
			
			var binding = new BasicHttpsBinding (BasicHttpsSecurityMode.TransportWithMessageCredential);
			
			exporter.ExportEndpoint (new ServiceEndpoint (
				cd, binding, new EndpointAddress (HttpsUri)));
			
			var doc = exporter.GetGeneratedMetadata ();
			return doc;
		}
开发者ID:vernon016,项目名称:mono,代码行数:14,代码来源:MetadataSamples.cs

示例13: BasicHttp_Config

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

示例14: Main

        static void Main(string[] args)
        {
            using (ServiceHost host = new ServiceHost(typeof(WcfServiceLibrary1.Service1)))
            {
                // surrogate definition..
                foreach (ServiceEndpoint ep in host.Description.Endpoints)
                {
                    foreach (OperationDescription op in ep.Contract.Operations)
                    {
                        DataContractSerializerOperationBehavior dataContractBehavior =
                            op.Behaviors.Find<DataContractSerializerOperationBehavior>()
                            as DataContractSerializerOperationBehavior;
                        if (dataContractBehavior != null)
                        {
                            dataContractBehavior.DataContractSurrogate = new valToTransferAsBytes();
                        }
                        else
                        {
                            dataContractBehavior = new DataContractSerializerOperationBehavior(op);
                            dataContractBehavior.DataContractSurrogate = new valToTransferAsBytes();
                            op.Behaviors.Add(dataContractBehavior);
                        }
                    }
                }

                // set up exporter with surrogate definition..
                WsdlExporter exporter = new WsdlExporter();
                object dataContractExporter;
                XsdDataContractExporter xsdInventoryExporter;
                if (!exporter.State.TryGetValue(typeof(XsdDataContractExporter),
                    out dataContractExporter))
                {
                    xsdInventoryExporter = new XsdDataContractExporter(exporter.GeneratedXmlSchemas);
                }
                else
                    xsdInventoryExporter = (XsdDataContractExporter)dataContractExporter;
                exporter.State.Add(typeof(XsdDataContractExporter), xsdInventoryExporter);


                if (xsdInventoryExporter.Options == null)
                    xsdInventoryExporter.Options = new ExportOptions();
                xsdInventoryExporter.Options.DataContractSurrogate = new valToTransferAsBytes();

                // export the endpoints..

                

                ServiceEndpointCollection sec = host.Description.Endpoints;
                foreach (ServiceEndpoint se in sec)
                {
                    Console.WriteLine(se.Name);
                    exporter.ExportEndpoint(se);
                }

                MetadataSet docs = null;
                docs = exporter.GetGeneratedMetadata();

                host.Description.


                host.Open();

                PrintDescription(host);

                Console.WriteLine("The Trading Service is available.  Press any key to exit.");
                Console.ReadKey();

                host.Close();
            }

        }
开发者ID:ehershey,项目名称:development,代码行数:71,代码来源:Program.cs

示例15: BasicHttp_Mtom

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


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