title: Calling web service returns The remote server returned an error: (502) Bad Gateway
body: <p>I am trying to call a web service in C# using WSDL proxy, the web service requires credentials to be passed</p>
  
  <pre><code>PartsInquiryServiceHttpService client = new PartsInquiryServiceHttpService();
          client.Url = "Url";
          client.Credentials = new NetworkCredential("user Name", "password");
  </code></pre>
  
  <p>In this line an exception is thrown</p>
  
  <pre><code>client.getMultiplePartsInquiry(enquiry);
  </code></pre>
  
  <p>unhandled exception of type 'System.Net.WebException' occurred in System.dll  Additional information: The remote server returned an error: (502) Bad Gateway</p>
  
  <p>Please help</p>