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 SinghalPosted Sep 30, 2015, 6:43 AM
http://tungnt.net/en/
Steven WongPosted Sep 29, 2015, 9:06 AM
Ashish SinghalPosted Sep 28, 2015, 7:56 PM