チャネル ファクトリを使用して WCF クライアントを作成しました。しかし、別のマシンのサーバーに接続できません。(407) Prxy Authentication Required 例外が発生します。
WSHttpBinding wsBinding = new WSHttpBinding();
wsBinding.BypassProxyOnLocal = true;
EndpointAddress endpoint =
new EndpointAddress("http://machineName:7676/MyWCFService");
ChannelFactory<IService> sericeInterface =
new ChannelFactory<IService>(wsBinding, endpoint);
sericeInterface.Credentials.Windows.ClientCredential = System.Net.CredentialCache.DefaultNetworkCredentials;
sericeInterface = sericeInterface.CreateChannel();
これは私のクライアント接続コードニペットです。サービスのメソッドを呼び出すと例外が発生します。