Your Windows Communication Foundation (WCF) client application uses HTTP to communicate with the service. You need to enable message logging and include all security information such as tokens and nonces in logged messages.
What should you do?
A.
In the application configuration file, add the logKnownPii attribute to the message logging diagnostics source and set the value of the attribute to true.
Generate the ContosoService class using the Add Service Reference wizard.
Add a reference to System.ServiceModel.Routing.dll.
Add the following code segment.
Dim client As ContosoService = New ContosoService()
Dim behavior As SoapProcessingBehavior = New SoapProcessingBehavior()
behavior.ProcessMessages = True
client.Endpoint.Behaviors.Add(behavior)
B.
In the application configuration file, add the following XML segment to the system.serviceModel configuration section group.
<diagnostics>
<messageLogging logMessagesAtTransportLevel=”true”
logEntireMessage=”true” />
</diagnostics>
C.
In the machine configuration file, add the following XML segment to the system.serviceModel configuration section.
<machineSettings enableLoggingKnownPii=”true” />
Generate the ContosoService class using the Add Service Reference wizard.
Add the following code segment.
Dim client As ContosoService = New ContosoService()
client.Endpoint.Behaviors.Add(New CallbackDebugBehavior(True))
D.
In the machine configuration file, add the following XML segment to the system.serviceModel configuration section.
<machineSettings enableLoggingKnownPii=”true” />
In the application configuration file, add the logKnownPii attribute to the message logging diagnostics source and set the value of the attribute to true.
In the application configuration file, add the following XML segment to the system.serviceModel configuration section group.
<diagnostics>
<messageLogging logMessagesAtTransportLevel=”true”/>
</diagnostics>