Reputation: 543
I made an aplication in WPF that is suppose to get the data on my form and save it to a database (through a data service). If I do this on my machine and in the server that is hosted the service all works fine. But if I do in a different machine I get DataServiceRequestException. I'm guessing is something with the config but the exception is not very acurate.
Is there a way to have more information from there?
I already have:
config.UseVerboseErrors = true;
and
[System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)]
On my service side.
Upvotes: 0
Views: 100
Reputation: 966
I think you could leverage IErrorHandler interface provide by service model to fetch all the exception coming in service operation. Below is the code and find the appropriate comments regarding how to debug:
[ServiceBehavior(IncludeExceptionDetailInFaults = true)]
public class YourService : IErrorHandler
{
public void ProvideFault(Exception error, MessageVersion version, ref Message fault)
{
//Put the break point and monitor the exception.
//or put some log in Handle error method.
}
public bool HandleError(Exception error)
{
//log the exception in this method as it run on separate thread.
return true;
}
}
I hope this answer your question.
Upvotes: 2