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.'
My code is
In client side:
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 channelFactory = new DuplexChannelFactory(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);
}

Ashish Singhal46 reputationPosted Sep 28, 2015, 3:56 PM EDT
Steven Wong3 reputationPosted Sep 29, 2015, 5:06 AM EDT
Ashish Singhal46 reputationPosted Sep 30, 2015, 2:43 AM EDT
http://tungnt.net/en/