title: Using C# Service Reference with Proxy
body: <p>I am trying to use a ServiceReference in a C# project.
  The project is intended to test a connection. I have a customer who is trying to connect with a C# application to one web service of one of my colleagues. The connection can't be established and he is assuming that it is our own mistake.</p>
  
  <p>I am trying to write now a simple C# project.
  Thats enough of story... now the Information needed.</p>
  
  <ol>
  <li>The customer uses a Proxy server</li>
  <li>I try to connect to this web service for testing reasons
  <a href="http://www.w3schools.com/webservices/tempconvert.asmx" rel="noreferrer">http://www.w3schools.com/webservices/tempconvert.asmx</a></li>
  <li>I Use .Net Framework 4.0</li>
  <li>My Project compiles into a Windows Forms application.</li>
  </ol>
  
  <p>Here The source code of my Method:</p>
  
  <pre><code>    private void button2_Click(object sender, EventArgs e)
      {
          try
          {
              //Create Client
              ServiceReference1.TempConvertSoapClient client = new ServiceReference1.TempConvertSoapClient(@"TempConvertSoap",@"http://www.w3schools.com/webservices/tempconvert.asmx");
              if (client.ClientCredentials != null)
              {
                  //Use Values which are typed in in the GUI
                  string user = tbUser.Text;
                  string password = tbPassword.Text;
                  string domain = tbDomain.Text;
  
                  //Check what information is used by the customer.
                  if (!string.IsNullOrEmpty(user) &amp;&amp; !string.IsNullOrEmpty(password) &amp;&amp; !string.IsNullOrEmpty(domain))
                  {
                      client.ClientCredentials.Windows.ClientCredential = new NetworkCredential(user, password, domain);
                  }
                  if (!string.IsNullOrEmpty(user) &amp;&amp; !string.IsNullOrEmpty(password))
                  {
                      client.ClientCredentials.Windows.ClientCredential = new NetworkCredential(user, password);
                  }
              }
              //Oh nooo... no temperature typed in
              if (string.IsNullOrEmpty(tbFahrenheit.Text))
              {
                  //GOOD BYE
                  return;
              }
              //Use the webservice 
              string celsius =  client.FahrenheitToCelsius(tbFahrenheit.Text); //&lt;-- Simple Calculation
              tbCelsius.Text = celsius;
          }
          catch(Exception ex) 
          {
              //Something 
              MessageBox.Show(ex.ToString());
          }
  
      }
  </code></pre>
  
  <p><strong>Here is my Question:</strong>
  How can i set a proxy to this service reference or rather the client ?
  There is no property or setter for this purpose. I tried it with the ClientCredentials</p>