Vrik22
asked on
500 Internal server Issue when making calls between RESTful services
i am using HttpClient call to make requests between the RESTful service calls .
I am migrating my code from MSMQ to RESTful calls to make calls between the RESTful services.
i have developed around 7 RESTful services which internally call each other for updating their respective Databases .
Now ., the common issue i am facing is when i deploy all these services and try to test end point of a service, i am getting 500 internal server error which i understand is due to the internal call failure to other service .
So , now i want to know is there any way where i can make such error handling more specific and get to know which internal service call failed ?
Thanks
I am migrating my code from MSMQ to RESTful calls to make calls between the RESTful services.
i have developed around 7 RESTful services which internally call each other for updating their respective Databases .
Now ., the common issue i am facing is when i deploy all these services and try to test end point of a service, i am getting 500 internal server error which i understand is due to the internal call failure to other service .
So , now i want to know is there any way where i can make such error handling more specific and get to know which internal service call failed ?
Thanks
ASKER
Thanks Ryan, i have already implemented config in that way and i have maintained a Logging class, but still when i try catch , i dont see exact way to catch the exception . I see InnerException as null .
try catch a general exception and debug accordingly? like:
try {
//your codes here...
}
catch (Exception e)
{
logger.Debug(e.Source + ":" + e.Message + ":" + e.StackTrace);
myClassOutput o = new myClassOutput();
o.UniqueID = 0;
o.ErrorMessage = "Your Error Message..";
o.ReturnValue = 0;
String json = JsonConvert.SerializeObject(o);
return WebOperationContext.Current.CreateTextResponse(json, "application/json; charset=utf-8", Encoding.UTF8);
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I am using C# .NET .i think from RESTful perspective apart from logging we need to debug locally individually check the services and resolve them.
1. Try to configure something like below in your web.config:
Under section: system.serviceModel , add:
Open in new window
2. Use some logger class to create the logs in your codes.
3. Additionally, in your web method, you may need to do a try catch and then output it for debugging.