Duplex Call Back Issue
-
Hi All, I am implimenting Duplex CallBack Contract for my Service. I am giving my Callback Interface Below. public interface IAsyncCallbackInterface { [OperationContract(IsOneWay = true)] void GetTheCurrentChannel(DuplexChannelFactory<IAsyncInterface> factory); } So when i am trying to open the host i am getting following error Type 'System.ServiceModel.DuplexChannelFactory`1[IAsyncInterface]' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. See the Microsoft .NET Framework documentation for other supported types. Here the IAsyncInterface is my ServiceContract. Since it is an interface how can i mark it as DataContract? Can any one plse tell me what is the issue here? Thanks Lijo
-
Hi All, I am implimenting Duplex CallBack Contract for my Service. I am giving my Callback Interface Below. public interface IAsyncCallbackInterface { [OperationContract(IsOneWay = true)] void GetTheCurrentChannel(DuplexChannelFactory<IAsyncInterface> factory); } So when i am trying to open the host i am getting following error Type 'System.ServiceModel.DuplexChannelFactory`1[IAsyncInterface]' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. See the Microsoft .NET Framework documentation for other supported types. Here the IAsyncInterface is my ServiceContract. Since it is an interface how can i mark it as DataContract? Can any one plse tell me what is the issue here? Thanks Lijo
That callback contract doesn't make sense. You are saying that your callback interface (service exposed on the client) has an operation which expects ChannelFactory as parameter from service. Why do you want to send channel factory from service to client? Btw. it is not possible because as exception says DuplexChannelFactory is not serializable.