분산 서버 응용 프로그램이 있습니다.FaultException이 원격 소스에서 발생했는지 감지합니다.
클라이언트가 슬레이브 서버에 연결하고 마스터 서버로 전파되는 메소드를 호출합니다. 마스터 서버는 FaultException<CustomFault>()
을 던집니다.
슬레이브 서버는 연결된 클라이언트에 FaultException<CustomFault>()
을 전파합니다. 그러나 클라이언트는 대신 비 일반 FaultException
을받습니다.
내가 잡아 그것을 다시 발생하는 경우가 예상대로 작동 슬레이브 서버 (FaultException<CustomFault>
의 새로운 인스턴스 생성) :
protected void Rethrow(Action action)
{
try
{
action();
}
catch (FaultException<CustomFault> kEx)
{
throw new FaultException<CustomFault>(kEx.Detail);
}
}
따라서 내 모든 인터페이스가 제대로 장식되어 있다고 가정합니다. 나는 단지 여러 서버를 통해 FaultExceptions을 던지는 것이 보안 문제로 간주된다고 가정 할 수 있습니다 ...
FaultException이 다른 서버에서 발생했는지 어떻게 확인할 수 있습니까? 통화 스택 확인 :
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
내게 잘못되었습니다. 더 좋은 아이디어?