I'm trying to implement the IErrorhandler
which is proving to be a real pain!
I have imlpement the provideFault method from the IErrorhandler
interface like so...
public void ProvideFault(Exception error, MessageVersion version, ref Message fault)
{
FaultException<ServiceFault> faultException = ServiceMethods.BuildFaultException<ServiceFault>("Provide Fault Error", error.Message);
MessageFault messageFault = faultException.CreateMessageFault();
fault = Message.CreateMessage(version, messageFault, faultException.Action);
}
If my service operations hit an exception it drops into this method to create a FaultException
. My problem is the client doesnt get this FaultException
returned to them.
Am I missing something obvious here?
Thanks in advance
I've a little experience with WCF, but I think that you're just creating a message and you're not sending it through a request or a response. I think for this reason your client doesn't get the message with the exception.
Did you implement the method
HandleError
of the IErrorHandler interface?Your question is similar to these questions already asked in SO:
Maybe they can help you.
Read also this thread in MSDN.