We have a requirement for logging requests without answers (in case of expiration) we do this for IClientMessageInspector Are using the implementation. Unfortunately, there is a second case in which no response is given later - when the service method is zero (nothing is back). Is there a way to identify zero method in First Sandwichist method?
There is no systematic way of doing this, but I have found an ugly one :)
/// & lt; Summary & gt; /// Examines the internal operation format for the action answer attribute, which is empty for methods in a manner. /// The answer to the service method will be based on the above-mentioned returns. /// & lt; / Summary & gt; /// & lt; Param name = "request" & gt; Request message. & Lt; / Param & gt; /// & lt; Returns & gt; Will the service method be answered? & Lt; / Returns & gt; Private Bull WillRequestHaveReply (Message Request) {FieldInfo operationFormatterField = request.GetType () .GetFields (BindingFlags.Instance | BindingFlags.NonPublic) FirstOrDefault (f => f.Name == "operationFormatter"); If (Operationformatfiled! = Null) {Object Operation Format = OperationformerField.get Value (request); If (Operationformer! = Null) {PropertyFodaActionReplyProperty = OperationformerGetType () .Gate Properties (BindingFlag.Instance | Binding FlagsNonPublic). FirstOver Default (P => P. Names == "Answer Answer"); If (Action RepliProperty! = Null) {Return Action UPPERPorty.Gate Value (Operation Format)! = Null; }}} // Every request must have an operation format. // Use standard behaviors (requests with replies) If it is not. Back true; }
No comments:
Post a Comment