CRM Blog

Tuesday, March 11, 2008 - Posts

Server Was Unable To Process Request - Generic Error Message
by Danny Varghese 03.11.08

Comments    2 Comment(s)

Issue

Often times, developers see the generic error message “server was unable to process request” that gets thrown when executing a callout in Microsoft CRM 3.0.  This message is a generic message that gets thrown to the windows event log.  Unfortunately, diagnosis of the actual problem can be very difficult from these types of messages. 

How To Diagnose A Bit Better

The best way, I’ve found is to trap this type of exception in your code, and print out the message, stack trace of the exception and the “inner exception.”  The specific exception thrown in this case is the System.Web.Services.Protocols.SoapException (http://msdn2.microsoft.com/en-us/library/system.web.services.protocols.soapexception.aspx).  The “outer exception” contains the “server was unable to process request” exception, but the “inner exception” contains a more detailed description (NOTE:  sometimes the inner exception may not be descriptive enough, but it should point you in the right direction).  An example of an inner exception would be “object not set to a reference,” which often times indicates trying to perform an action on a null object.

Code Snippet

Below is an illustration of how to trap that exception and print it out.

try

{

     //do something here

}

catch (SoapException se)

{

     Console.WriteLine(se.Message + “ “ + se.StackTrace);

     Console.WriteLine(se.InnerException.Message + “ “ + se.InnerException.StackTrace);

}

Filed under: