public static void AttributeNoPropertiesContract() { System.ServiceModel.ChannelFactory <IServiceModelSimpleService> factory = DispatcherHelper.CreateChannelFactory <ServiceModelSimpleService, IServiceModelSimpleService>(); factory.Open(); IServiceModelSimpleService channel = factory.CreateChannel(); ((System.ServiceModel.Channels.IChannel)channel).Open(); string echo = channel.Echo("hello"); Assert.Equal("hello", echo); ((System.ServiceModel.Channels.IChannel)channel).Close(); factory.Close(); TestHelper.CloseServiceModelObjects((System.ServiceModel.Channels.IChannel)channel, factory); }
public static void AttributesForMessageContract() { System.ServiceModel.ChannelFactory <IServiceModelSimpleService> factory = DispatcherHelper.CreateChannelFactory <ServiceModelSimpleService, IServiceModelSimpleService>(); factory.Open(); IServiceModelSimpleService channel = factory.CreateChannel(); ((System.ServiceModel.Channels.IChannel)channel).Open(); EchoMessageResponse echo = channel.EchoWithMessageContract(new EchoMessageRequest() { Text = "Message Hello", APIKey = "DEVKEYTOTEST" }); Assert.NotNull(echo); Assert.NotEmpty(echo.SayHello); Assert.NotEmpty(echo.SayHi); ((System.ServiceModel.Channels.IChannel)channel).Close(); factory.Close(); TestHelper.CloseServiceModelObjects((System.ServiceModel.Channels.IChannel)channel, factory); }