static internal void MessageFlowAtMessageSent(Message message, EventTraceActivity eventTraceActivity) { if (TraceUtility.MessageFlowTracing) { Guid activityId; Guid correlationId; bool activityIdFound = ActivityIdHeader.ExtractActivityAndCorrelationId(message, out activityId, out correlationId); if (TraceUtility.MessageFlowTracingOnly) { if (activityIdFound && activityId != DiagnosticTraceBase.ActivityId) { DiagnosticTraceBase.ActivityId = activityId; } } if (WcfEventSource.Instance.MessageSentToTransportIsEnabled()) { WcfEventSource.Instance.MessageSentToTransport(eventTraceActivity, correlationId); } } }
static internal void MessageFlowAtMessageReceived(Message message, OperationContext context, EventTraceActivity eventTraceActivity, bool createNewActivityId) { if (TraceUtility.MessageFlowTracing) { Guid activityId; Guid correlationId; bool activityIdFound = ActivityIdHeader.ExtractActivityAndCorrelationId(message, out activityId, out correlationId); if (TraceUtility.MessageFlowTracingOnly) { if (createNewActivityId) { if (!activityIdFound) { activityId = Guid.NewGuid(); activityIdFound = true; } //message flow tracing only - start fresh DiagnosticTraceBase.ActivityId = Guid.Empty; } if (activityIdFound) { FxTrace.Trace.SetAndTraceTransfer(activityId, !createNewActivityId); } } if (WcfEventSource.Instance.MessageReceivedFromTransportIsEnabled()) { if (context == null) { context = OperationContext.Current; } WcfEventSource.Instance.MessageReceivedFromTransport(eventTraceActivity, correlationId, TraceUtility.GetAnnotation(context)); } } }