From 291af9c5800a35563948b35cc3b0b9fe1680b049 Mon Sep 17 00:00:00 2001 From: "Carol Wang (Inspur Worldwide Services Ltd)" Date: Mon, 4 Mar 2019 16:21:03 +0800 Subject: [PATCH] Fix XmlSerilizerFormat test issue --- .../tests/Common/Scenarios/Endpoints.cs | 2 +- .../Common/Scenarios/ServiceInterfaces.cs | 110 ++++++- .../XmlSerializer/XmlSerializerFormatTest.cs | 272 +++++++++++++++--- .../App_code/IXmlSerFormatAttrServices.cs | 110 ++++++- .../App_code/XmlSerFormatAttrServices.cs | 66 +---- .../BasicHttpXmlSerFormatAttrServiceHost.cs | 118 +++++++- .../tools/IISHostedWcfService/Web.config | 12 +- .../tools/SelfHostedWcfService/Program.cs | 12 +- 8 files changed, 559 insertions(+), 143 deletions(-) diff --git a/src/System.Private.ServiceModel/tests/Common/Scenarios/Endpoints.cs b/src/System.Private.ServiceModel/tests/Common/Scenarios/Endpoints.cs index fb7af171868..da91ee8b4cb 100644 --- a/src/System.Private.ServiceModel/tests/Common/Scenarios/Endpoints.cs +++ b/src/System.Private.ServiceModel/tests/Common/Scenarios/Endpoints.cs @@ -104,7 +104,7 @@ public static string XmlSFAttribute_Address get { return GetEndpointAddress("XmlSFAttribute.svc//XmlSFAttribute"); } } - public static string BasciHttpRpcEncSingleNs_Address + public static string BasicHttpRpcEncSingleNs_Address { get { return GetEndpointAddress("BasicHttpRpcEncSingleNs.svc//Basic"); } } diff --git a/src/System.Private.ServiceModel/tests/Common/Scenarios/ServiceInterfaces.cs b/src/System.Private.ServiceModel/tests/Common/Scenarios/ServiceInterfaces.cs index 96e58a8d9df..0db061e1806 100644 --- a/src/System.Private.ServiceModel/tests/Common/Scenarios/ServiceInterfaces.cs +++ b/src/System.Private.ServiceModel/tests/Common/Scenarios/ServiceInterfaces.cs @@ -647,41 +647,123 @@ public interface IXmlSFAttribute void TestXmlSerializerSupportsFaults_False(); } -[ServiceContract(Namespace = "http://contoso.com/calc"), XmlSerializerFormat] -public interface ICalculator +[ServiceContract(Namespace = "http://contoso.com/calc")] +[XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] +public interface ICalculatorRpcEnc { - [OperationContract, XmlSerializerFormat] + [OperationContract] int Sum2(int i, int j); - [OperationContract, XmlSerializerFormat] + [OperationContract] int Sum(IntParams par); - [OperationContract, XmlSerializerFormat] + [OperationContract] float Divide(FloatParams par); - [OperationContract, XmlSerializerFormat] + [OperationContract] string Concatenate(IntParams par); - [OperationContract, XmlSerializerFormat] + [OperationContract] void AddIntParams(Guid guid, IntParams par); - [OperationContract, XmlSerializerFormat] + [OperationContract] IntParams GetAndRemoveIntParams(Guid guid); - [OperationContract, XmlSerializerFormat] + [OperationContract] DateTime ReturnInputDateTime(DateTime dt); - [OperationContract, XmlSerializerFormat] + [OperationContract] byte[] CreateSet(ByteParams par); } -[ServiceContract, XmlSerializerFormat] -public interface IHelloWorld +[ServiceContract(Namespace = "http://contoso.com/calc")] +[XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Literal)] +public interface ICalculatorRpcLit { - [OperationContract, XmlSerializerFormat] + [OperationContract] + int Sum2(int i, int j); + + [OperationContract] + int Sum(IntParams par); + + [OperationContract] + float Divide(FloatParams par); + + [OperationContract] + string Concatenate(IntParams par); + + [OperationContract] + void AddIntParams(Guid guid, IntParams par); + + [OperationContract] + IntParams GetAndRemoveIntParams(Guid guid); + + [OperationContract] + DateTime ReturnInputDateTime(DateTime dt); + + [OperationContract] + byte[] CreateSet(ByteParams par); +} + +[ServiceContract(Namespace = "http://contoso.com/calc")] +[XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)] +public interface ICalculatorDocLit +{ + [OperationContract] + int Sum2(int i, int j); + + [OperationContract] + int Sum(IntParams par); + + [OperationContract] + float Divide(FloatParams par); + + [OperationContract] + string Concatenate(IntParams par); + + [OperationContract] + void AddIntParams(Guid guid, IntParams par); + + [OperationContract] + IntParams GetAndRemoveIntParams(Guid guid); + + [OperationContract] + DateTime ReturnInputDateTime(DateTime dt); + + [OperationContract] + byte[] CreateSet(ByteParams par); +} + +[ServiceContract] +[XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] +public interface IHelloWorldRpcEnc +{ + [OperationContract] void AddString(Guid guid, string testString); - [OperationContract, XmlSerializerFormat] + [OperationContract] + string GetAndRemoveString(Guid guid); +} + +[ServiceContract] +[XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Literal)] +public interface IHelloWorldRpcLit +{ + [OperationContract] + void AddString(Guid guid, string testString); + + [OperationContract] + string GetAndRemoveString(Guid guid); +} + +[ServiceContract] +[XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)] +public interface IHelloWorldDocLit +{ + [OperationContract] + void AddString(Guid guid, string testString); + + [OperationContract] string GetAndRemoveString(Guid guid); } diff --git a/src/System.Private.ServiceModel/tests/Scenarios/Contract/XmlSerializer/XmlSerializerFormatTest.cs b/src/System.Private.ServiceModel/tests/Scenarios/Contract/XmlSerializer/XmlSerializerFormatTest.cs index 8619b8eb3c7..978bbba388e 100644 --- a/src/System.Private.ServiceModel/tests/Scenarios/Contract/XmlSerializer/XmlSerializerFormatTest.cs +++ b/src/System.Private.ServiceModel/tests/Scenarios/Contract/XmlSerializer/XmlSerializerFormatTest.cs @@ -87,63 +87,278 @@ public static void XmlSerializerFormatAttribute_SupportFaults() [OuterLoop] public static void XmlSFAttributeRpcEncSingleNsTest() { - RunVariation(Endpoints.BasciHttpRpcEncSingleNs_Address); + BasicHttpBinding binding = null; + EndpointAddress endpointAddress = null; + ChannelFactory factory1 = null; + ICalculatorRpcEnc serviceProxy1 = null; + + // *** SETUP *** \\ + binding = new BasicHttpBinding(); + endpointAddress = new EndpointAddress(Endpoints.BasicHttpRpcEncSingleNs_Address); + factory1 = new ChannelFactory(binding, endpointAddress); + serviceProxy1 = factory1.CreateChannel(); + + // *** EXECUTE Variation *** \\ + try + { + var dateTime = DateTime.Now; + var intParams = new IntParams() { P1 = 5, P2 = 10 }; + var floatParams = new FloatParams() { P1 = 5.0f, P2 = 10.0f }; + var byteParams = new ByteParams() { P1 = 5, P2 = 10 }; + + Assert.Equal(3, serviceProxy1.Sum2(1, 2)); + Assert.Equal(intParams.P1 + intParams.P2, serviceProxy1.Sum(intParams)); + Assert.Equal(string.Format("{0}{1}", intParams.P1, intParams.P2), serviceProxy1.Concatenate(intParams)); + Assert.Equal((float)(floatParams.P1 / floatParams.P2), serviceProxy1.Divide(floatParams)); + Assert.Equal((new byte[] { byteParams.P1, byteParams.P2 }), serviceProxy1.CreateSet(byteParams)); + Assert.Equal(dateTime, serviceProxy1.ReturnInputDateTime(dateTime)); + + Guid guid = Guid.NewGuid(); + serviceProxy1.AddIntParams(guid, intParams); + IntParams outputIntParams = serviceProxy1.GetAndRemoveIntParams(guid); + Assert.NotNull(outputIntParams); + Assert.Equal(intParams.P1, outputIntParams.P1); + Assert.Equal(intParams.P2, outputIntParams.P2); + } + catch (Exception ex) + { + Assert.True(false, ex.Message); + } + finally + { + // *** ENSURE CLEANUP *** \\ + ScenarioTestHelpers.CloseCommunicationObjects((ICommunicationObject)serviceProxy1); + } } [WcfFact] [OuterLoop] public static void XmlSFAttributeRpcLitSingleNsTest() { - RunVariation(Endpoints.BasicHttpRpcLitSingleNs_Address); + BasicHttpBinding binding = null; + EndpointAddress endpointAddress = null; + ChannelFactory factory1 = null; + ICalculatorRpcLit serviceProxy1 = null; + + // *** SETUP *** \\ + binding = new BasicHttpBinding(); + endpointAddress = new EndpointAddress(Endpoints.BasicHttpRpcLitSingleNs_Address); + factory1 = new ChannelFactory(binding, endpointAddress); + serviceProxy1 = factory1.CreateChannel(); + + // *** EXECUTE Variation *** \\ + try + { + var dateTime = DateTime.Now; + var intParams = new IntParams() { P1 = 5, P2 = 10 }; + var floatParams = new FloatParams() { P1 = 5.0f, P2 = 10.0f }; + var byteParams = new ByteParams() { P1 = 5, P2 = 10 }; + + Assert.Equal(3, serviceProxy1.Sum2(1, 2)); + Assert.Equal(intParams.P1 + intParams.P2, serviceProxy1.Sum(intParams)); + Assert.Equal(string.Format("{0}{1}", intParams.P1, intParams.P2), serviceProxy1.Concatenate(intParams)); + Assert.Equal((float)(floatParams.P1 / floatParams.P2), serviceProxy1.Divide(floatParams)); + Assert.Equal((new byte[] { byteParams.P1, byteParams.P2 }), serviceProxy1.CreateSet(byteParams)); + Assert.Equal(dateTime, serviceProxy1.ReturnInputDateTime(dateTime)); + + Guid guid = Guid.NewGuid(); + serviceProxy1.AddIntParams(guid, intParams); + IntParams outputIntParams = serviceProxy1.GetAndRemoveIntParams(guid); + Assert.NotNull(outputIntParams); + Assert.Equal(intParams.P1, outputIntParams.P1); + Assert.Equal(intParams.P2, outputIntParams.P2); + } + catch (Exception ex) + { + Assert.True(false, ex.Message); + } + finally + { + // *** ENSURE CLEANUP *** \\ + ScenarioTestHelpers.CloseCommunicationObjects((ICommunicationObject)serviceProxy1); + } } [WcfFact] [OuterLoop] public static void XmlSFAttributeDocLitSingleNsTest() { - RunVariation(Endpoints.BasicHttpDocLitSingleNs_Address); + BasicHttpBinding binding = null; + EndpointAddress endpointAddress = null; + ChannelFactory factory1 = null; + ICalculatorDocLit serviceProxy1 = null; + + // *** SETUP *** \\ + binding = new BasicHttpBinding(); + endpointAddress = new EndpointAddress(Endpoints.BasicHttpDocLitSingleNs_Address); + factory1 = new ChannelFactory(binding, endpointAddress); + serviceProxy1 = factory1.CreateChannel(); + + // *** EXECUTE Variation *** \\ + try + { + var dateTime = DateTime.Now; + var intParams = new IntParams() { P1 = 5, P2 = 10 }; + var floatParams = new FloatParams() { P1 = 5.0f, P2 = 10.0f }; + var byteParams = new ByteParams() { P1 = 5, P2 = 10 }; + + Assert.Equal(3, serviceProxy1.Sum2(1, 2)); + Assert.Equal(intParams.P1 + intParams.P2, serviceProxy1.Sum(intParams)); + Assert.Equal(string.Format("{0}{1}", intParams.P1, intParams.P2), serviceProxy1.Concatenate(intParams)); + Assert.Equal((float)(floatParams.P1 / floatParams.P2), serviceProxy1.Divide(floatParams)); + Assert.Equal((new byte[] { byteParams.P1, byteParams.P2 }), serviceProxy1.CreateSet(byteParams)); + Assert.Equal(dateTime, serviceProxy1.ReturnInputDateTime(dateTime)); + + Guid guid = Guid.NewGuid(); + serviceProxy1.AddIntParams(guid, intParams); + IntParams outputIntParams = serviceProxy1.GetAndRemoveIntParams(guid); + Assert.NotNull(outputIntParams); + Assert.Equal(intParams.P1, outputIntParams.P1); + Assert.Equal(intParams.P2, outputIntParams.P2); + } + catch (Exception ex) + { + Assert.True(false, ex.Message); + } + finally + { + // *** ENSURE CLEANUP *** \\ + ScenarioTestHelpers.CloseCommunicationObjects((ICommunicationObject)serviceProxy1); + } } [WcfFact] [OuterLoop] public static void XmlSFAttributeRpcEncDualNsTest() { - RunVariation(Endpoints.BasicHttpRpcEncDualNs_Address, true); + BasicHttpBinding binding = null; + EndpointAddress endpointAddress = null; + ChannelFactory factory1 = null; + ChannelFactory factory2 = null; + ICalculatorRpcEnc serviceProxy1 = null; + IHelloWorldRpcEnc serviceProxy2 = null; + + // *** SETUP *** \\ + binding = new BasicHttpBinding(); + endpointAddress = new EndpointAddress(Endpoints.BasicHttpRpcEncDualNs_Address); + factory1 = new ChannelFactory(binding, endpointAddress); + serviceProxy1 = factory1.CreateChannel(); + factory2 = new ChannelFactory(binding, endpointAddress); + serviceProxy2 = factory2.CreateChannel(); + + // *** EXECUTE Variation *** \\ + try + { + var dateTime = DateTime.Now; + string testStr = "test string"; + var intParams = new IntParams() { P1 = 5, P2 = 10 }; + var floatParams = new FloatParams() { P1 = 5.0f, P2 = 10.0f }; + var byteParams = new ByteParams() { P1 = 5, P2 = 10 }; + + Assert.Equal(3, serviceProxy1.Sum2(1, 2)); + Assert.Equal(intParams.P1 + intParams.P2, serviceProxy1.Sum(intParams)); + Assert.Equal(string.Format("{0}{1}", intParams.P1, intParams.P2), serviceProxy1.Concatenate(intParams)); + Assert.Equal((float)(floatParams.P1 / floatParams.P2), serviceProxy1.Divide(floatParams)); + Assert.Equal((new byte[] { byteParams.P1, byteParams.P2 }), serviceProxy1.CreateSet(byteParams)); + Assert.Equal(dateTime, serviceProxy1.ReturnInputDateTime(dateTime)); + + Guid guid = Guid.NewGuid(); + serviceProxy1.AddIntParams(guid, intParams); + IntParams outputIntParams = serviceProxy1.GetAndRemoveIntParams(guid); + Assert.NotNull(outputIntParams); + Assert.Equal(intParams.P1, outputIntParams.P1); + Assert.Equal(intParams.P2, outputIntParams.P2); + Guid guid2 = Guid.NewGuid(); + serviceProxy2.AddString(guid2, testStr); + Assert.Equal(testStr, serviceProxy2.GetAndRemoveString(guid2)); + } + catch (Exception ex) + { + Assert.True(false, ex.Message); + } + finally + { + // *** ENSURE CLEANUP *** \\ + ScenarioTestHelpers.CloseCommunicationObjects((ICommunicationObject)serviceProxy1); + ScenarioTestHelpers.CloseCommunicationObjects((ICommunicationObject)serviceProxy2); + } } [WcfFact] [OuterLoop] public static void XmlSFAttributeRpcLitDualNsTest() { - RunVariation(Endpoints.BasicHttpRpcLitDualNs_Address, true); + BasicHttpBinding binding = null; + EndpointAddress endpointAddress = null; + ChannelFactory factory1 = null; + ChannelFactory factory2 = null; + ICalculatorRpcLit serviceProxy1 = null; + IHelloWorldRpcLit serviceProxy2 = null; + + // *** SETUP *** \\ + binding = new BasicHttpBinding(); + endpointAddress = new EndpointAddress(Endpoints.BasicHttpRpcLitDualNs_Address); + factory1 = new ChannelFactory(binding, endpointAddress); + serviceProxy1 = factory1.CreateChannel(); + factory2 = new ChannelFactory(binding, endpointAddress); + serviceProxy2 = factory2.CreateChannel(); + + // *** EXECUTE Variation *** \\ + try + { + var dateTime = DateTime.Now; + string testStr = "test string"; + var intParams = new IntParams() { P1 = 5, P2 = 10 }; + var floatParams = new FloatParams() { P1 = 5.0f, P2 = 10.0f }; + var byteParams = new ByteParams() { P1 = 5, P2 = 10 }; + + Assert.Equal(3, serviceProxy1.Sum2(1, 2)); + Assert.Equal(intParams.P1 + intParams.P2, serviceProxy1.Sum(intParams)); + Assert.Equal(string.Format("{0}{1}", intParams.P1, intParams.P2), serviceProxy1.Concatenate(intParams)); + Assert.Equal((float)(floatParams.P1 / floatParams.P2), serviceProxy1.Divide(floatParams)); + Assert.Equal((new byte[] { byteParams.P1, byteParams.P2 }), serviceProxy1.CreateSet(byteParams)); + Assert.Equal(dateTime, serviceProxy1.ReturnInputDateTime(dateTime)); + + Guid guid = Guid.NewGuid(); + serviceProxy1.AddIntParams(guid, intParams); + IntParams outputIntParams = serviceProxy1.GetAndRemoveIntParams(guid); + Assert.NotNull(outputIntParams); + Assert.Equal(intParams.P1, outputIntParams.P1); + Assert.Equal(intParams.P2, outputIntParams.P2); + Guid guid2 = Guid.NewGuid(); + serviceProxy2.AddString(guid2, testStr); + Assert.Equal(testStr, serviceProxy2.GetAndRemoveString(guid2)); + } + catch (Exception ex) + { + Assert.True(false, ex.Message); + } + finally + { + // *** ENSURE CLEANUP *** \\ + ScenarioTestHelpers.CloseCommunicationObjects((ICommunicationObject)serviceProxy1); + ScenarioTestHelpers.CloseCommunicationObjects((ICommunicationObject)serviceProxy2); + } } [WcfFact] [OuterLoop] public static void XmlSFAttributeDocLitDualNsTest() - { - RunVariation(Endpoints.BasicHttpDocLitDualNs_Address, true); - } - - private static void RunVariation(string serviceAddress, bool isMultiNs = false) { BasicHttpBinding binding = null; EndpointAddress endpointAddress = null; - ChannelFactory factory1 = null; - ChannelFactory factory2 = null; - ICalculator serviceProxy1 = null; - IHelloWorld serviceProxy2 = null; + ChannelFactory factory1 = null; + ChannelFactory factory2 = null; + ICalculatorDocLit serviceProxy1 = null; + IHelloWorldDocLit serviceProxy2 = null; // *** SETUP *** \\ binding = new BasicHttpBinding(); - endpointAddress = new EndpointAddress(serviceAddress); - factory1 = new ChannelFactory(binding, endpointAddress); + endpointAddress = new EndpointAddress(Endpoints.BasicHttpDocLitDualNs_Address); + factory1 = new ChannelFactory(binding, endpointAddress); serviceProxy1 = factory1.CreateChannel(); - if (isMultiNs) - { - factory2 = new ChannelFactory(binding, endpointAddress); - serviceProxy2 = factory2.CreateChannel(); - } + factory2 = new ChannelFactory(binding, endpointAddress); + serviceProxy2 = factory2.CreateChannel(); // *** EXECUTE Variation *** \\ try @@ -167,13 +382,9 @@ private static void RunVariation(string serviceAddress, bool isMultiNs = false) Assert.NotNull(outputIntParams); Assert.Equal(intParams.P1, outputIntParams.P1); Assert.Equal(intParams.P2, outputIntParams.P2); - - if (isMultiNs) - { - Guid guid2 = Guid.NewGuid(); - serviceProxy2.AddString(guid2, testStr); - Assert.Equal(testStr, serviceProxy2.GetAndRemoveString(guid2)); - } + Guid guid2 = Guid.NewGuid(); + serviceProxy2.AddString(guid2, testStr); + Assert.Equal(testStr, serviceProxy2.GetAndRemoveString(guid2)); } catch (Exception ex) { @@ -183,10 +394,7 @@ private static void RunVariation(string serviceAddress, bool isMultiNs = false) { // *** ENSURE CLEANUP *** \\ ScenarioTestHelpers.CloseCommunicationObjects((ICommunicationObject)serviceProxy1); - if (isMultiNs) - { - ScenarioTestHelpers.CloseCommunicationObjects((ICommunicationObject)serviceProxy2); - } + ScenarioTestHelpers.CloseCommunicationObjects((ICommunicationObject)serviceProxy2); } } } diff --git a/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/IXmlSerFormatAttrServices.cs b/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/IXmlSerFormatAttrServices.cs index 3367d1c2211..633bf5580c6 100644 --- a/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/IXmlSerFormatAttrServices.cs +++ b/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/IXmlSerFormatAttrServices.cs @@ -8,41 +8,123 @@ namespace WcfService { - [ServiceContract(Namespace = "http://contoso.com/calc"), XmlSerializerFormat] - public interface ICalculator + [ServiceContract(Namespace = "http://contoso.com/calc")] + [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] + public interface ICalculatorRpcEnc { - [OperationContract, XmlSerializerFormat] + [OperationContract] int Sum2(int i, int j); - [OperationContract, XmlSerializerFormat] + [OperationContract] int Sum(IntParams par); - [OperationContract, XmlSerializerFormat] + [OperationContract] float Divide(FloatParams par); - [OperationContract, XmlSerializerFormat] + [OperationContract] string Concatenate(IntParams par); - [OperationContract, XmlSerializerFormat] + [OperationContract] void AddIntParams(Guid guid, IntParams par); - [OperationContract, XmlSerializerFormat] + [OperationContract] IntParams GetAndRemoveIntParams(Guid guid); - [OperationContract, XmlSerializerFormat] + [OperationContract] DateTime ReturnInputDateTime(DateTime dt); - [OperationContract, XmlSerializerFormat] + [OperationContract] byte[] CreateSet(ByteParams par); } - [ServiceContract, XmlSerializerFormat] - public interface IHelloWorld + [ServiceContract(Namespace = "http://contoso.com/calc")] + [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Literal)] + public interface ICalculatorRpcLit { - [OperationContract, XmlSerializerFormat] + [OperationContract] + int Sum2(int i, int j); + + [OperationContract] + int Sum(IntParams par); + + [OperationContract] + float Divide(FloatParams par); + + [OperationContract] + string Concatenate(IntParams par); + + [OperationContract] + void AddIntParams(Guid guid, IntParams par); + + [OperationContract] + IntParams GetAndRemoveIntParams(Guid guid); + + [OperationContract] + DateTime ReturnInputDateTime(DateTime dt); + + [OperationContract] + byte[] CreateSet(ByteParams par); + } + + [ServiceContract(Namespace = "http://contoso.com/calc")] + [XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)] + public interface ICalculatorDocLit + { + [OperationContract] + int Sum2(int i, int j); + + [OperationContract] + int Sum(IntParams par); + + [OperationContract] + float Divide(FloatParams par); + + [OperationContract] + string Concatenate(IntParams par); + + [OperationContract] + void AddIntParams(Guid guid, IntParams par); + + [OperationContract] + IntParams GetAndRemoveIntParams(Guid guid); + + [OperationContract] + DateTime ReturnInputDateTime(DateTime dt); + + [OperationContract] + byte[] CreateSet(ByteParams par); + } + + [ServiceContract] + [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] + public interface IHelloWorldRpcEnc + { + [OperationContract] + void AddString(Guid guid, string testString); + + [OperationContract] + string GetAndRemoveString(Guid guid); + } + + [ServiceContract] + [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Literal)] + public interface IHelloWorldRpcLit + { + [OperationContract] + void AddString(Guid guid, string testString); + + [OperationContract] + string GetAndRemoveString(Guid guid); + } + + [ServiceContract] + [XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)] + public interface IHelloWorldDocLit + { + [OperationContract] void AddString(Guid guid, string testString); - [OperationContract, XmlSerializerFormat] + [OperationContract] string GetAndRemoveString(Guid guid); } diff --git a/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/XmlSerFormatAttrServices.cs b/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/XmlSerFormatAttrServices.cs index 0393478dad9..88dc16d1103 100644 --- a/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/XmlSerFormatAttrServices.cs +++ b/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/XmlSerFormatAttrServices.cs @@ -10,40 +10,35 @@ namespace WcfService { [ServiceBehavior(IncludeExceptionDetailInFaults = true)] - public class RpcEncSingleNsService : ICalculator + public class RpcEncSingleNsService : ICalculatorRpcEnc { private static ConcurrentDictionary s_sessions = new ConcurrentDictionary(); [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] public int Sum2(int i, int j) { return i + j; } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] public int Sum(IntParams par) { return par.P1 + par.P2; } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] public float Divide(FloatParams par) { return (float)(par.P1 / par.P2); } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] public string Concatenate(IntParams par) { return string.Format("{0}{1}", par.P1, par.P2); } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] public void AddIntParams(Guid guid, IntParams par) { if (!s_sessions.TryAdd(guid, par)) @@ -53,7 +48,6 @@ public void AddIntParams(Guid guid, IntParams par) } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] public IntParams GetAndRemoveIntParams(Guid guid) { object value; @@ -62,14 +56,12 @@ public IntParams GetAndRemoveIntParams(Guid guid) } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] public DateTime ReturnInputDateTime(DateTime dt) { return dt; } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] public byte[] CreateSet(ByteParams par) { return new byte[] { par.P1, par.P2 }; @@ -77,40 +69,35 @@ public byte[] CreateSet(ByteParams par) } [ServiceBehavior(IncludeExceptionDetailInFaults = true)] - public class RpcLitSingleNsService : ICalculator + public class RpcLitSingleNsService : ICalculatorRpcLit { private static ConcurrentDictionary s_sessions = new ConcurrentDictionary(); [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Literal)] public int Sum2(int i, int j) { return i + j; } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Literal)] public int Sum(IntParams par) { return par.P1 + par.P2; } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Literal)] public float Divide(FloatParams par) { return (float)(par.P1 / par.P2); } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Literal)] public string Concatenate(IntParams par) { return string.Format("{0}{1}", par.P1, par.P2); } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Literal)] public void AddIntParams(Guid guid, IntParams par) { if (!s_sessions.TryAdd(guid, par)) @@ -120,7 +107,6 @@ public void AddIntParams(Guid guid, IntParams par) } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Literal)] public IntParams GetAndRemoveIntParams(Guid guid) { object value; @@ -129,14 +115,12 @@ public IntParams GetAndRemoveIntParams(Guid guid) } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Literal)] public DateTime ReturnInputDateTime(DateTime dt) { return dt; } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Literal)] public byte[] CreateSet(ByteParams par) { return new byte[] { par.P1, par.P2 }; @@ -144,40 +128,35 @@ public byte[] CreateSet(ByteParams par) } [ServiceBehavior(IncludeExceptionDetailInFaults = true)] - public class DocLitSingleNsService : ICalculator + public class DocLitSingleNsService : ICalculatorDocLit { private static ConcurrentDictionary s_sessions = new ConcurrentDictionary(); [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)] public int Sum2(int i, int j) { return i + j; } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)] public int Sum(IntParams par) { return par.P1 + par.P2; } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)] public float Divide(FloatParams par) { return (float)(par.P1 / par.P2); } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)] public string Concatenate(IntParams par) { return string.Format("{0}{1}", par.P1, par.P2); } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)] public void AddIntParams(Guid guid, IntParams par) { if (!s_sessions.TryAdd(guid, par)) @@ -187,7 +166,6 @@ public void AddIntParams(Guid guid, IntParams par) } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)] public IntParams GetAndRemoveIntParams(Guid guid) { object value; @@ -196,14 +174,12 @@ public IntParams GetAndRemoveIntParams(Guid guid) } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)] public DateTime ReturnInputDateTime(DateTime dt) { return dt; } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)] public byte[] CreateSet(ByteParams par) { return new byte[] { par.P1, par.P2 }; @@ -211,40 +187,35 @@ public byte[] CreateSet(ByteParams par) } [ServiceBehavior(IncludeExceptionDetailInFaults = true)] - public class RpcEncDualNsService : ICalculator, IHelloWorld + public class RpcEncDualNsService : ICalculatorRpcEnc, IHelloWorldRpcEnc { private static ConcurrentDictionary s_sessions = new ConcurrentDictionary(); [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] public int Sum2(int i, int j) { return i + j; } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] public int Sum(IntParams par) { return par.P1 + par.P2; } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] public float Divide(FloatParams par) { return (float)(par.P1 / par.P2); } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] public string Concatenate(IntParams par) { return string.Format("{0}{1}", par.P1, par.P2); } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] public void AddIntParams(Guid guid, IntParams par) { if (!s_sessions.TryAdd(guid, par)) @@ -254,7 +225,6 @@ public void AddIntParams(Guid guid, IntParams par) } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] public IntParams GetAndRemoveIntParams(Guid guid) { object value; @@ -263,21 +233,18 @@ public IntParams GetAndRemoveIntParams(Guid guid) } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] public DateTime ReturnInputDateTime(DateTime dt) { return dt; } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] public byte[] CreateSet(ByteParams par) { return new byte[] { par.P1, par.P2 }; } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] public void AddString(Guid guid, string testString) { if (!s_sessions.TryAdd(guid, testString)) @@ -287,7 +254,6 @@ public void AddString(Guid guid, string testString) } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Encoded)] public string GetAndRemoveString(Guid guid) { object value; @@ -297,40 +263,35 @@ public string GetAndRemoveString(Guid guid) } [ServiceBehavior(IncludeExceptionDetailInFaults = true)] - public class RpcLitDualNsService : ICalculator, IHelloWorld + public class RpcLitDualNsService : ICalculatorRpcLit, IHelloWorldRpcLit { private static ConcurrentDictionary s_sessions = new ConcurrentDictionary(); [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Literal)] public int Sum2(int i, int j) { return i + j; } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Literal)] public int Sum(IntParams par) { return par.P1 + par.P2; } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Literal)] public float Divide(FloatParams par) { return (float)(par.P1 / par.P2); } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Literal)] public string Concatenate(IntParams par) { return string.Format("{0}{1}", par.P1, par.P2); } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Literal)] public void AddIntParams(Guid guid, IntParams par) { if (!s_sessions.TryAdd(guid, par)) @@ -340,7 +301,6 @@ public void AddIntParams(Guid guid, IntParams par) } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Literal)] public IntParams GetAndRemoveIntParams(Guid guid) { object value; @@ -349,21 +309,18 @@ public IntParams GetAndRemoveIntParams(Guid guid) } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Literal)] public DateTime ReturnInputDateTime(DateTime dt) { return dt; } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Literal)] public byte[] CreateSet(ByteParams par) { return new byte[] { par.P1, par.P2 }; } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Literal)] public void AddString(Guid guid, string testString) { if (!s_sessions.TryAdd(guid, testString)) @@ -373,7 +330,6 @@ public void AddString(Guid guid, string testString) } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Rpc, Use = OperationFormatUse.Literal)] public string GetAndRemoveString(Guid guid) { object value; @@ -383,40 +339,35 @@ public string GetAndRemoveString(Guid guid) } [ServiceBehavior(IncludeExceptionDetailInFaults = true)] - public class DocLitDualNsService : ICalculator, IHelloWorld + public class DocLitDualNsService : ICalculatorDocLit, IHelloWorldDocLit { private static ConcurrentDictionary s_sessions = new ConcurrentDictionary(); [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)] public int Sum2(int i, int j) { return i + j; } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)] public int Sum(IntParams par) { return par.P1 + par.P2; } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)] public float Divide(FloatParams par) { return (float)(par.P1 / par.P2); } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)] public string Concatenate(IntParams par) { return string.Format("{0}{1}", par.P1, par.P2); } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)] public void AddIntParams(Guid guid, IntParams par) { if (!s_sessions.TryAdd(guid, par)) @@ -426,7 +377,6 @@ public void AddIntParams(Guid guid, IntParams par) } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)] public IntParams GetAndRemoveIntParams(Guid guid) { object value; @@ -435,21 +385,18 @@ public IntParams GetAndRemoveIntParams(Guid guid) } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)] public DateTime ReturnInputDateTime(DateTime dt) { return dt; } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)] public byte[] CreateSet(ByteParams par) { return new byte[] { par.P1, par.P2 }; } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)] public void AddString(Guid guid, string testString) { if (!s_sessions.TryAdd(guid, testString)) @@ -459,7 +406,6 @@ public void AddString(Guid guid, string testString) } [OperationBehavior] - [XmlSerializerFormat(Style = OperationFormatStyle.Document, Use = OperationFormatUse.Literal)] public string GetAndRemoveString(Guid guid) { object value; diff --git a/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/testhosts/BasicHttpXmlSerFormatAttrServiceHost.cs b/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/testhosts/BasicHttpXmlSerFormatAttrServiceHost.cs index 976d2fe10d8..53361070dee 100644 --- a/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/testhosts/BasicHttpXmlSerFormatAttrServiceHost.cs +++ b/src/System.Private.ServiceModel/tools/IISHostedWcfService/App_code/testhosts/BasicHttpXmlSerFormatAttrServiceHost.cs @@ -9,16 +9,16 @@ namespace WcfService { - public class XmlSerializerICalculatorServiceHostFactory : ServiceHostFactory + public class XmlSerializerICalculatorRpcEncServiceHostFactory : ServiceHostFactory { protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses) { - var serviceHost = new XmlSerializerICalculatorServiceHost(serviceType, baseAddresses); + var serviceHost = new XmlSerializerICalculatorRpcEncServiceHost(serviceType, baseAddresses); return serviceHost; } } - public class XmlSerializerICalculatorServiceHost : TestServiceHostBase + public class XmlSerializerICalculatorRpcEncServiceHost : TestServiceHostBase { protected override string Address { get { return "Basic"; } } @@ -27,32 +27,130 @@ protected override Binding GetBinding() return new BasicHttpBinding(); } - public XmlSerializerICalculatorServiceHost(Type serviceType, params Uri[] baseAddresses) + public XmlSerializerICalculatorRpcEncServiceHost(Type serviceType, params Uri[] baseAddresses) : base(serviceType, baseAddresses) { } } - public class XmlSerializerDualContractServiceHostFactory : ServiceHostFactory + public class XmlSerializerICalculatorRpcLitServiceHostFactory : ServiceHostFactory { protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses) { - var serviceHost = new XmlSerializerDualContractServiceHost(serviceType, baseAddresses); + var serviceHost = new XmlSerializerICalculatorRpcLitServiceHost(serviceType, baseAddresses); return serviceHost; } } - public class XmlSerializerDualContractServiceHost : TestServiceHostBase + public class XmlSerializerICalculatorRpcLitServiceHost : TestServiceHostBase { - protected static Binding binding; protected override string Address { get { return "Basic"; } } protected override Binding GetBinding() { - return binding = binding == null ? new BasicHttpBinding() : binding; + return new BasicHttpBinding(); + } + + public XmlSerializerICalculatorRpcLitServiceHost(Type serviceType, params Uri[] baseAddresses) + : base(serviceType, baseAddresses) + { + } + } + + public class XmlSerializerICalculatorDocLitServiceHostFactory : ServiceHostFactory + { + protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses) + { + var serviceHost = new XmlSerializerICalculatorDocLitServiceHost(serviceType, baseAddresses); + return serviceHost; + } + } + + public class XmlSerializerICalculatorDocLitServiceHost : TestServiceHostBase + { + protected override string Address { get { return "Basic"; } } + + protected override Binding GetBinding() + { + return new BasicHttpBinding(); + } + + public XmlSerializerICalculatorDocLitServiceHost(Type serviceType, params Uri[] baseAddresses) + : base(serviceType, baseAddresses) + { + } + } + + public class XmlSerializerDualContractRpcEncServiceHostFactory : ServiceHostFactory + { + protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses) + { + var serviceHost = new XmlSerializerDualContractRpcEncServiceHost(serviceType, baseAddresses); + return serviceHost; + } + } + + public class XmlSerializerDualContractRpcEncServiceHost : TestServiceHostBase + { + protected static Binding s_binding; + protected override string Address { get { return "Basic"; } } + + protected override Binding GetBinding() + { + return s_binding = s_binding == null ? new BasicHttpBinding() : s_binding; + } + + public XmlSerializerDualContractRpcEncServiceHost(Type serviceType, params Uri[] baseAddresses) + : base(serviceType, baseAddresses) + { + } + } + + public class XmlSerializerDualContractRpcLitServiceHostFactory : ServiceHostFactory + { + protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses) + { + var serviceHost = new XmlSerializerDualContractRpcLitServiceHost(serviceType, baseAddresses); + return serviceHost; + } + } + + public class XmlSerializerDualContractRpcLitServiceHost : TestServiceHostBase + { + protected static Binding s_binding; + protected override string Address { get { return "Basic"; } } + + protected override Binding GetBinding() + { + return s_binding = s_binding == null ? new BasicHttpBinding() : s_binding; + } + + public XmlSerializerDualContractRpcLitServiceHost(Type serviceType, params Uri[] baseAddresses) + : base(serviceType, baseAddresses) + { + } + } + + public class XmlSerializerDualContractDocLitServiceHostFactory : ServiceHostFactory + { + protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses) + { + var serviceHost = new XmlSerializerDualContractDocLitServiceHost(serviceType, baseAddresses); + return serviceHost; + } + } + + public class XmlSerializerDualContractDocLitServiceHost : TestServiceHostBase + { + protected static Binding s_binding; + protected override string Address { get { return "Basic"; } } + + protected override Binding GetBinding() + { + return s_binding = s_binding == null ? new BasicHttpBinding() : s_binding; } - public XmlSerializerDualContractServiceHost(Type serviceType, params Uri[] baseAddresses) + public XmlSerializerDualContractDocLitServiceHost(Type serviceType, params Uri[] baseAddresses) : base(serviceType, baseAddresses) { } diff --git a/src/System.Private.ServiceModel/tools/IISHostedWcfService/Web.config b/src/System.Private.ServiceModel/tools/IISHostedWcfService/Web.config index 0d4ec4f6a9c..6e36af5d68a 100644 --- a/src/System.Private.ServiceModel/tools/IISHostedWcfService/Web.config +++ b/src/System.Private.ServiceModel/tools/IISHostedWcfService/Web.config @@ -106,12 +106,12 @@ - - - - - - + + + + + + diff --git a/src/System.Private.ServiceModel/tools/SelfHostedWcfService/Program.cs b/src/System.Private.ServiceModel/tools/SelfHostedWcfService/Program.cs index 3ae5900b323..debb2e2b6e7 100644 --- a/src/System.Private.ServiceModel/tools/SelfHostedWcfService/Program.cs +++ b/src/System.Private.ServiceModel/tools/SelfHostedWcfService/Program.cs @@ -122,12 +122,12 @@ private static void Main() CreateHost("DataContractResolver.svc", httpBaseAddress); CreateHost("UnderstoodHeaders.svc", httpBaseAddress); CreateHost("XmlSFAttribute.svc", httpBaseAddress); - CreateHost("BasicHttpRpcEncSingleNs.svc", httpBaseAddress); - CreateHost("BasicHttpRpcLitSingleNs.svc", httpBaseAddress); - CreateHost("BasicHttpDocLitSingleNs.svc", httpBaseAddress); - CreateHost("BasicHttpRpcEncDualNs.svc", httpBaseAddress); - CreateHost("BasicHttpRpcLitDualNs.svc", httpBaseAddress); - CreateHost("BasicHttpDocLitDualNs.svc", httpBaseAddress); + CreateHost("BasicHttpRpcEncSingleNs.svc", httpBaseAddress); + CreateHost("BasicHttpRpcLitSingleNs.svc", httpBaseAddress); + CreateHost("BasicHttpDocLitSingleNs.svc", httpBaseAddress); + CreateHost("BasicHttpRpcEncDualNs.svc", httpBaseAddress); + CreateHost("BasicHttpRpcLitDualNs.svc", httpBaseAddress); + CreateHost("BasicHttpDocLitDualNs.svc", httpBaseAddress); //Start the crlUrl service last as the client use it to ensure all services have been started Uri testHostUrl = new Uri(string.Format("http://localhost/TestHost.svc", s_httpPort));