Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7603177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:36:06+00:00 2026-05-30T23:36:06+00:00

I have a web service that runs perfectly when i reference it from within

  • 0

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.

I tried placing an error message into object returns, but it’s still not making it out; something like this:

public bool SetDirectReports(ADUser user)
{
    try
    {
        var adEntry = new DirectoryEntry(string.Format("LDAP://<GUID={0}>", user.Guid), "administrator", "S3cur1ty");
        if (adEntry.Properties["directReports"].Count > 0)
        {
            user.DirectReports = new List<ADUser>();
            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<ADUser>();
            return false;
        }
    }
    catch (Exception ex)
    {
        user.HasError = true;
        user.ErrorMessage = "Error setting direct reports: " + ex.Message;
        return false;
    }

}

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.S. this isn’t necessarily the method thats crashing, there’s a web of them in the service.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:36:06+00:00Added an answer on May 30, 2026 at 11:36 pm

    You should dump all of your exceptions to a log file on the server side; exposing error information to the client is a potential security risk, which is why it’s turned off by default.

    If you really want to send exception information to the client, you can turn it on. If you are using a WCF service you should set the “includeExceptionDetailsInFaults” property on for the service behavior, as described in this MSDN article on dealing with unhandled exceptions in WCF. Once you do so, you will have a property on the FaultException called Detail that should itself be a type of Exception.

    For better error handling you should also take a look at typed faults using the FaultContract and FaultException<> class; these have the benefit that they don’t throw the channel into a faulted state and can be handled correctly:

    try
    {
        // do stuff here
    }
    catch (Exception ex)
    {
        var detail = new CustomFaultDetail 
        {
           Message = "Error setting direct reports: " + ex.Message
        };
    
        throw new FaultException<CustomFaultDetail>(detail);
    }
    

    If you are using an ASP.NET Web Service, you should set the customErrors mode to “Off” in your web.config. This will send back the entire exception detail as HTML, which the client should receive as part of the SOAP exception that it receives.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an Apache tomcat server that runs a current web service. We were
I have a medium sized application that runs as a .net web-service which I
I have a web service that queries data from this json file, but I
I have a WCF service that runs in my web application that provides data
I have a web app, that consumes a web service. The main page runs
I have a web-service that I will be deploying to dev, staging and production.
I have a web service that I created in C# and a test harness
I have a web service that uses Python's SimpleJSON to serialize JSON, and a
I have a web service that is protected by requiring the consuming third party
I have a web service that needs different settings for different environments (debug, test,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.