I am having a problem getting through an authenticating proxy using Basic authentication with WSHttpBinding.
Similar code for BasicHttpBinding works. I am guessing that my problem something to do with the fact that I can't set the Security mode of the WSHttpBinding to TransportCredentialOnly..
I can't use BasicHttpBinding because of a dependency on MTOM.
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();