1
我目前正在开发一个WCF双工服务,我想实现的回调方法在我的客户端应用程序但有是如何解决执行回调方法时收到的错误?
'App.CallbackHandler' does not implement interface member IPostingServiceCallback.retrieveNotification(Service.Posting)'
为我服务的服务合同的错误情况如下
[ServiceContract(SessionMode=SessionMode.Required , CallbackContract = typeof(IPostingServiceCallBack))]
public interface IPostingService
{
[OperationContract(IsOneWay = true)]
void postNotification(Posting post);
}
public interface IPostingServiceCallBack
{
[OperationContract]
String retrieveNotification(Posting post);
}
我已生成代理并添加到我的客户端的项目文件中,并将端点地址添加到app.config中。
编辑
我在我的客户端应用程序的代码是目前
public class CallBackHandler : IPostingServiceCallback
{
public void retrieveNotification()
{
//planning to do something
}
}
嗨,这就是我目前在我的客户端应用程序。输入后它会出现上述错误。 – Thomas
@Thomas - 我根据对原始问题的编辑更新了我的答案。 – Tim
非常感谢! – Thomas