我在通過身份驗證代理使用基本通過WSHttpBinding進行身份驗證時遇到問題。是否可以通過使用WsHttpBinding的基本身份驗證代理?
BasicHttpBinding的相似的編碼。我猜測,我的問題的東西的事實,我不能設置的WSHttpBinding的安全模式TransportCredentialOnly ..
我不能使用,因爲MTOM上的依賴的basicHttpBinding的事。所有的一件事
binding.ProxyAddress = new Uri("http://192.168.20.231:8080");
binding.BypassProxyOnLocal = true;
binding.UseDefaultWebProxy = false;
WSHttpSecurity security = binding.Security;
//security.Mode = SecurityMode.TransportCredentialOnly; //This option only exist for BasichHttpBinding
security.Mode = SecurityMode.Transport; // Not sure what to set here
//security.Mode = SecurityMode.TransportWithMessageCredential;
security.Transport.ProxyCredentialType = HttpProxyCredentialType.Basic;
security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
var client = new SyncWcfMTOMServiceClient(binding, new EndpointAddress("http://server/service.svc"));
client.ClientCredentials.UserName.UserName = "user";
client.ClientCredentials.UserName.Password = "pass";
bool running = client.IsServiceRunning();
它不是託管在https上它是一個非常標準的代理服務器 – 2009-05-18 12:38:43