tags:

views:

2087

answers:

2

I have a problem to connect to my WCF service if customer is using proxy with credentials. I'm unable to find the way to set credential to generated client proxy.

If I use the web service, then it is possible to set proxy.

+2  A: 

Not sure if this is what you are looking for but the below is a working code sample to authenticate using the client credentials.

    Dim client As ProductServiceClient = New ProductServiceClient("wsHttpProductService")
    client.ClientCredentials.UserName.UserName = "username"
    client.ClientCredentials.UserName.Password = "password"
    Dim ProductList As List(Of Product) = client.GetProducts()
    mView.Products = ProductList
    client.Close()
Toran Billups
+2  A: 

I'm not entirely sure if this is what you are looking for but here you go.

  MyClient client = new MyClient();
  client.ClientCredentials.UserName.UserName = "u";
  client.ClientCredentials.UserName.Password = "p";
Pawel Pabich
It doesn't seem to work for NTLM proxy. I needed to fill in `client.ClientCredentials.Windows` to get it to work.
Tomek Szpakowicz