コールバックのあるサービスを作成しました。これはうまくいっています。次に、このサービスを耐久性のあるものにしたいと思います。私の問題は、コンテキストを取得して後で再度ロードすることです。次のようにサービスを呼び出します。
class UserManagementProxy : IUserManagementCallback, IDisposable
{
IUserManagement pipeProxy = null;
public InfoMessage Login(string username, string password)
{
DuplexChannelFactory<IUserManagement> pipeFactory = new DuplexChannelFactory<IUserManagement>(new InstanceContext(this), new NetTcpContextBinding(), new EndpointAddress(Properties.Settings.Default.Adress));
InfoMessage message = null;
try
{
pipeProxy = pipeFactory.CreateChannel();
LoginResult result = pipeProxy.Login(Guid.Parse("b06cbb6f-1c99-4e02-91a7-f7d778b29790"), username, password);
return result.Status;
}
catch (Exception ex)
{
}
}
}
コンテキストを今どこに保存する必要がありますか?また、どうすればこれを行うことができますか? クライアントベースでいくつかのことをしようとしました...しかし、これは別の解決策だと思います。同じサービス インスタンスに再度アクセスする正しい方法は何ですか?
助けてくれてありがとうマックス