Does somebody know why the output of this code is only : "Message Sended" ? The thread of the input channel wait on channel.Recieve().
I have not this problem using basicHttpBinding with IRequest/ReplyChannel !
static void Main(string[] args)
{
WSHttpBinding binding = new WSHttpBinding();
binding.ReliableSession.Enabled = true;
binding.ReliableSession.Ordered = true;
var messsage = System.ServiceModel.Channels.Message.CreateMessage(MessageVersion.Soap11, "hello", "action");
var senderFacto = binding.BuildChannelFactory<IOutputSessionChannel>();
var recieveFacto = binding.BuildChannelListener<IInputSessionChannel>(new Uri("http://localhost:9393"));
senderFacto.Open();
recieveFacto.Open();
var sender = senderFacto.CreateChannel(new System.ServiceModel.EndpointAddress("http://localhost:9393"));
sender.Open();
sender.BeginSend(messsage, (o) =>
{
sender.EndSend(o);
Console.WriteLine("Message Sended");
sender.Close();
},null);
recieveFacto.BeginAcceptChannel((o) =>
{
var channel = recieveFacto.EndAcceptChannel(o);
channel.Open();
var message = channel.Receive();
Console.WriteLine("Message Recieved");
},null);
Console.Read();
}
Solution Turn off the security on the channel, then change the message version to Soap12Adressing10
binding.Security.Mode = SecurityMode.None; //Turn off the security
var messsage = System.ServiceModel.Channels.Message.CreateMessage(MessageVersion.Soap12WSAddressing10, "hello", "action"); //Change message version
Thanks,