title: how do i get an exception out of a web service?
body: <p>I have a web service that runs perfectly when i reference it from within the project solution. As soon as i upload it to the remote server, it starts blowing up. Unfortunately, the only error message I get is on the client side "faultexception was unhandled by user code". Inside of the web service, I have exceptions handled in all of the methods, so I'm pretty sure it's getting caught somewhere, but I don't know how to see it. I suspect that the problem is permissions related, but I can't see where it's happening.</p>
  
  <p>I tried placing an error message into object returns, but it's still not making it out; something like this:</p>
  
  <pre><code>public bool SetDirectReports(ADUser user)
  {
      try
      {
          var adEntry = new DirectoryEntry(string.Format("LDAP://&lt;GUID={0}&gt;", user.Guid), "administrator", "S3cur1ty");
          if (adEntry.Properties["directReports"].Count &gt; 0)
          {
              user.DirectReports = new List&lt;ADUser&gt;();
              foreach (string directReport in adEntry.Properties["directReports"]) //is being returned as full distinguished name
              {
                  var dr = new DirectoryEntry(string.Format("LDAP://{0}", directReport), "administrator", "S3cur1ty");
                  user.DirectReports.Add(GetUserByGuid(dr.NativeGuid));
              }
              return true;
          }
          else
          {
              user.DirectReports = new List&lt;ADUser&gt;();
              return false;
          }
      }
      catch (Exception ex)
      {
          user.HasError = true;
          user.ErrorMessage = "Error setting direct reports: " + ex.Message;
          return false;
      }
  
  }
  </code></pre>
  
  <p>but its' still not catching. I was hoping for a better approach. I'm not sure if I could add something that would output the exception to the console or what. Any help would be appreciated. TIA</p>
  
  <p>P.S. this isn't necessarily the method thats crashing, there's a web of them in the service.</p>