我需要返回WCF服务的客户端HandlingInstanceId值,以便他们在发生错误的情况下可以使用此Guid参考返回。
我正在关注以下视频教程
https://www.youtube.com/watch?v=7wF4QXcD9yo
public class GlobalErrorHandler : IErrorHandler
{
public void ProvideFault(Exception error, MessageVersion version, ref
Message fault)
{
if (error is FaultException)
return;
FaultException faultException = new FaultException("General
Service Error Occured");
var msgFault = faultException.CreateMessageFault();
fault = Message.CreateMessage(version, msgFault, null);
}
public bool HandleError(Exception error)
{
return true;
}
}