validation - WCF FaultException - crashes App Pool when "re-throwing" from internal WCF call -
I have a WCF service that is hosted in IIS, and uses a WS HTTP binding (external service) . This service calls for a second WCF service, which is hosted in a Windows service, more than the Net TCP (Internal Service). When the internal service throws a fault excitation
, the client crashes the external service instead of throwing it. All customers see that the connection is being forced to be closed.
The Internal Service uses the Enterprise Library Verification Application Block to validate incoming messages. ValidationFault & gt;
Both internal and external services are a [FaultContract (typeof (ValidationFault)] FaultException & lt > Specialty in the service contract, I change the external service, then just instantly make a new
FaultException & lt; ValidaitonFault & gt;.
, this gets back to the customer's fine. Exception can hold exceptions from, but if I try to throw it again I wrap it in a new exception, and throw the whole application pool in IIS crashses. I can not see anything useful in the event log, so I'm not sure what the problem really is.
Customer service uses external services to communicate with the internal service is definitely being shut down and is being handled properly. How do I propagate the defects of internal service to the customer?
Updated:
Below is a simplified version of the external service code I can catch the verification error from the internal service call . If I have a new FaultException & lt; ValidationFault & gt;
Throw it, then it's all right. If I use the caught caught, the connection of the external client is broken. The only difference is that I can see when the service is debugging - the exceptions stuck in a message box, when trying to use the method that says exit exit
type 'Exception of an un-action is done in System.ServiceModel .FaultException`1' mscorlib.dll
It does not appear that I put a new exception. It may be that the answer to this question is to copy the details of the recognition mistake in a new object itself, but it seems crazy
public class ExternalService:. IExternalService {Public ExternalResponse DoSomething (ExternalRequest) {{Try to Retry Response = New External Response (); (Var Internal Client = New Internal Client ()) using {response.Data = internalClient.DoSomething (). Data; } Return response; } Hold (FaultException & lt; ValidationFault & gt; fEx) {// Throw FEx; & Lt; - Crash / Throw New Fault Mode & lt; ValidationFault & gt; (// Fx ValidationFlot description); & Lt; - crashses throw new FaultException & LT; ValidationFault & gt; (New ValidationFault (new ValidationDetail; New ValidationDetail ("Message", "Key", "Tag")}), "Error Message", New FaultCode ("faultCode")); // works fine! I have almost the exact design and you press similar problem (hit). ()}}}}
However, the accident is not definitive!) .
If I remember correctly, even if validation default
is a normal class, when Fotal travels on the wire, the type is typical WCF interface I think this web Namespace on services is due to qualifiers (but it was a while back so I could have been wrong)
It is not very elegant, but what I did is manually re-exception:
{dustf}; } Hold (FaultException & lt; ValidationFault & gt; fe) {handloom (fee); throw; } ... Private Zero HandleFault (FaultException & lt; ValidationFault & gt; FE); ValidationFault & gt; (ValidationFault form fe.Detail) {New FaultException & lt throw; }
Comments
Post a Comment