I am new on WCF and I am writing a universal app with WCF callback but got a exception 'Operation is not supported on this platform.'
Uri addr = new Uri("net.tcp://localhost:8733/Service1/");
EndpointAddress endpoint = new EndpointAddress(addr);
Service1CallbackService scbs = new Service1CallbackService();
InstanceContext callback = new InstanceContext(scbs);
NetTcpBinding binding = new NetTcpBinding();
NetTcpSecurity ntSecurity = new NetTcpSecurity();
ntSecurity.Mode = SecurityMode.None;
binding.Security = ntSecurity;
// throw exception in here
DuplexChannelFactory<IService1> channelFactory = new DuplexChannelFactory<IService1>(callback, binding, endpoint);
In WCF Service [ServiceContract(SessionMode = SessionMode.Required, CallbackContract = typeof(IMyContractCallBack))]
public interface IService1
{
[OperationContract(IsOneWay = true)]
void SendMessage(string ID, string message);
}
public interface IMyContractCallBack
{
[OperationContract(IsOneWay = true)]
void NotifyPCReceivedMessage(string ID, string message);
}