From a2e746f20082b6ada9fc7c665a6c44f43c181bca Mon Sep 17 00:00:00 2001 From: asfyra Date: Fri, 23 Nov 2018 16:14:27 +0200 Subject: [PATCH] The clone method in ClientTelemetryBindingElement did not copy the parameters passed from web.config So if someone had for example set the IgnoreChannelEvents property to true in web.config, the open event would be tracked in telemetry anyway. --- WCF/Shared/ClientTelemetryEndpointBehavior.cs | 1 + .../Implementation/ClientTelemetryBindingElement.cs | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/WCF/Shared/ClientTelemetryEndpointBehavior.cs b/WCF/Shared/ClientTelemetryEndpointBehavior.cs index c2a5fe2..c002904 100644 --- a/WCF/Shared/ClientTelemetryEndpointBehavior.cs +++ b/WCF/Shared/ClientTelemetryEndpointBehavior.cs @@ -103,6 +103,7 @@ void IEndpointBehavior.AddBindingParameters(ServiceEndpoint endpoint, BindingPar SoapRootOperationIdHeaderName = this.SoapRootOperationIdHeaderName, SoapParentOperationIdHeaderName = this.SoapParentOperationIdHeaderName, SoapHeaderNamespace = this.SoapHeaderNamespace, + IgnoreChannelEvents = this.IgnoreChannelEvents }; var originalBinding = endpoint.Binding; diff --git a/WCF/Shared/Implementation/ClientTelemetryBindingElement.cs b/WCF/Shared/Implementation/ClientTelemetryBindingElement.cs index 90f8d09..911d452 100644 --- a/WCF/Shared/Implementation/ClientTelemetryBindingElement.cs +++ b/WCF/Shared/Implementation/ClientTelemetryBindingElement.cs @@ -38,7 +38,15 @@ public ClientTelemetryBindingElement(TelemetryClient client, ClientContract map) public override BindingElement Clone() { - return new ClientTelemetryBindingElement(this.telemetryClient, this.operationMap); + return new ClientTelemetryBindingElement(this.telemetryClient, this.operationMap) + { + RootOperationIdHeaderName = this.RootOperationIdHeaderName, + ParentOperationIdHeaderName = this.ParentOperationIdHeaderName, + SoapRootOperationIdHeaderName = this.SoapRootOperationIdHeaderName, + SoapParentOperationIdHeaderName = this.SoapParentOperationIdHeaderName, + SoapHeaderNamespace = this.SoapHeaderNamespace, + IgnoreChannelEvents = this.IgnoreChannelEvents + }; } public override T GetProperty(BindingContext context)