A web service running in IIS but through a factory doesn't keep up the original exception thrown.
For example:
My web service has been marked up with FaultContractAttribute like this way:
public interface IMyService
{
[FaultContract(typeof(MyCustomException))]
[OperationContract]
bool IsAuthorized();
}
My web service implementation has throws out a custom exception like this way:
public class MyService : IMyService
{
public bool IsAuthorized()
{
throw new FaultException<MyCustomException>(fault, fr);
}
}
Then:
If my WCF - NOT using any factory - is similar to
<%@ ServiceHost Language="C#" Debug="true" Service="MyService" %>
, then on client side I CAN pick up the original exception (MyCustomException)If my WCF - USING some factory - is similar to
<%@ ServiceHost Language="C#" Debug="true" Service="MyService" Factory="MyFactory" %>
, then on client side I CAN'T pick up the original exception (MyCustomException) but only SOAP exception (FaultException) with useless general trace & message
Note:
WCF factory MyFactory is implemented with its SERVICE HOST contains a SERVICE BEHAVIOR initiated from IErrorHandler
In this service behavior, method ProvideFault does nothing (I haven't known how to keep up the original exception by this way)
In summary, I beg answers from expects: How to keep up the original exception (MyCustomException) while using some WCF factory ? Thanks.