title: 400: bad request
body: <p>I'm using csmanage to access the Azure Management API. This is my code:</p>
  
  <pre><code>    private const string subscriberID = "&lt;id&gt;";
  
      static void Main(string[] args)
      {
          // The thumbprint value of the management certificate.
          // You must replace the string with the thumbprint of a 
          // management certificate associated with your subscription.
          string certThumbprint = "&lt;thumbprint&gt;";
  
          // Create a reference to the My certificate store.
          X509Store certStore = new X509Store(StoreName.My, StoreLocation.CurrentUser);
  
          // Try to open the store.
          try
          {
              certStore.Open(OpenFlags.ReadOnly);
          }
          catch (Exception e)
          {
              throw;
          }
  
          // Find the certificate that matches the thumbprint.
          X509Certificate2Collection certCollection = certStore.Certificates.Find(X509FindType.FindByThumbprint, certThumbprint, false);
          certStore.Close();
  
          // Check to see if our certificate was added to the collection. If no, throw an error, if yes, create a certificate using it.
          if (0 == certCollection.Count)
          {
              throw new Exception("Error: No certificate found containing thumbprint " + certThumbprint);
          }
  
          // Create an X509Certificate2 object using our matching certificate.
          X509Certificate2 certificate = certCollection[0];
  
  
  
          var serviceManagment = ServiceManagementHelper.CreateServiceManagementChannel("WindowsAzureEndPoint", new X509Certificate2(certificate));
          var x = serviceManagment.ListHostedServices(subscriberID);
  
          foreach (HostedService s in x)
          {
              Console.WriteLine(s.ServiceName);
          }
      }
  </code></pre>
  
  <p>This works fine in a console application. However, when I execute the exact same code in a WCF project (as a service implementation) I'm getting <code>400 - Bad Request</code> as a result.</p>
  
  <p>What could cause this error?</p>