A Windows Communication Foundation (WCF) service only accepts messages that are signed and encrypted.
A client application is not receiving expected responses from the service.
You need to enable logging to verify that the messages from the client are signed and encrypted.
You also need to see what each message looks like before the message body is deserialized into a NET object. What should you do?
A.
Configure the System.ServiceModel trace source in the system.diagnostics configuration section.
In the system.serviceModel configuration, add the following XML segment:
<diagnostics>
<messageLogging logEntireMessage=”true” logMessagesAtServiceLeveI=”true” logMessagesAtTransportLevel=”true” />
</diagnostics>
B.
Configure the System.ServiceModel trace source in the system.diagnostics configuration section.
In the system.serviceModel configuration, add the following XML segment:
<diagnostics>
<messageLogging logEntireMessage=”true” logMessagesAtServiceLeveI=”true” />
</diagnostics>
C.
Configure the System.ServiceModel.MessageLogging trace source in the system.diagnostics configuration section.
In the system.serviceModel configuration, add the following XML segment:
<diagnostics>
<messageLogging logEntireMessage=”true” logMessagesAtServiceLeveI=”true” logMessagesAtTransportLevel=”true” />
</diagnostics>
D.
Configure the System.ServiceModel.MessageLogging trace source in the system.diagnostics configuration section.
In the system.serviceModel configuration, add the following XML segment:
<diagnostics>
<messageLogging logMessagesAtServiceLevel=”true” logMessagesAtTransportLevel=”true” />
</diagnostics>
Explanation:
MessageLoggingElement properties:
LogEntireMessage Gets or sets a value that specifies whether the entire message (message header and body) is logged.
LogMessagesAtServiceLevel Gets or sets a value that specifies whether messages are traced at the service level (before encryption and transport-related transforms).
LogMessagesAtTransportLevel Gets or sets a value that specifies whether messages are traced at the transport level.Configuring Message Logging
(http://msdn.microsoft.com/en-us/library/ms730064.aspx)Example:
<system.diagnostics>
<sources>
<source name=”System.ServiceModel.MessageLogging”>
<listeners>
<add name=”messages”
type=”System.Diagnostics.XmlWriterTraceListener”
initializeData=”c:\logs\messages.svclog” />
</listeners>
</source>
</sources>
</system.diagnostics><system.serviceModel>
<diagnostics>
<messageLogging
logEntireMessage=”true”
logMalformedMessages=”false”
logMessagesAtServiceLevel=”true”
logMessagesAtTransportLevel=”false”
maxMessagesToLog=”3000″
maxSizeOfMessageToLog=”2000″/>
</diagnostics>
</system.serviceModel>
Answers A and C are identical.
Oh wait- no they aren’t. Sorry.
C