1
こんにちは、ICommunicationObject.Stateは機能しませんか?
私はDuplexChannelFactoryと私のWCFクライアントを作成し、問題は、私はこれを行うときということです:
((ICommunicationObject)this.GetMyServiceInterfaceChannel).State
を私がfollowin例外を取得:
は、フィールドまたはコールを取得できません型 'System.ServiceModel.ICommunicationObject'のインスタンス上のメソッドは、リモートオブジェクトへのプロキシであるためです。
なぜですか?
チャンネルに障害があるかどうかを確認する必要があります。
EDIT1:IClientChannelとして
ClientService clientService = new ClientService();
InstanceContext context = new InstanceContext(clientService);
DuplexChannelFactory<My.ServiceContracts.IMyClientService> factory = new DuplexChannelFactory<My.ServiceContracts.IMyClientService>(context, connectionName);
factory.Credentials.UserName.UserName = anvandarNamn;
factory.Credentials.UserName.Password = password;
return factory.CreateChannel();
IClentChannelを使用する場合と全く同じ例外が発生しますか? – Banshee
'GetMyServiceInterfaceChannel'作成のコードを追加できますか? – Fabske
私の編集を見てください。 – Banshee