googlebot
Buy Differin Gel Online
ADVERTISEMENT

Get Familiar With Windows Communication Application Development

  By Certification Magazine —

1 | 2 | 3 | 4 | 5 |

 

References:

MSDN2 Library > .NET Framework 3.5 > Windows Communication Foundation > Basic WCF Programming > Configuring Services > Configuring Services Using Configuration Files

MSDN2 Library > .NET Framework 3.5 > Windows Communication Foundation > Basic WCF Programming > Configuring Services > Bindings > Configuring Bindings for Windows Communication Foundation Services

MSDN2 Library > .NET Framework 3.5 > Windows Communication Foundation > WCF Feature Details > AJAX Integration and JSON Support > Creating WCF Services for ASP.NET AJAX > How to: Use Configuration to Add an ASP.NET AJAX Endpoint

 

 

Objective: Instrument and administer services.

Sub-objective: Implement end-to-end service tracing.

  

Single answer, multiple-choice

 

You are configuring end-to-end tracing for a Windows Communication Foundation (WCF) service developed using the Microsoft .NET 3.5 Framework. You have added the following listener declaration to system.diagnostics section of the configuration file:

<sharedListeners>
     <add name="xmlListener"
       initializeData="C:\Logs\web_tracelog.svclog"
       type="System.Diagnostics.XmlWriterTraceListener" />
</sharedListeners>

You want to trace the service activities to debug and optimize its operations. The trace should use the specified listener. Which setting should you add to the configuration file?

 

A.     <sources>
     <source name="System.Runtime.Serialization"
       switchValue="Verbose,ActivityTracing">
          <listeners>
               <add name="xmlListener" />
          </listeners>
     </source>
</sources>

B.     <sources>
     <source name="System.Runtime.Serialization"
       switchValue="Critical,ActivityTracing">
          <listeners>
               <add name="xmlListener" />
          </listeners>
     </source>
</sources>

C.     <sources>
     <source name="System.ServiceModel"
       switchValue="Critical,ActivityTracing">
          <listeners>
               <add name="xmlListener" />
          </listeners>
     </source>
</sources>

D.     <sources>
     <source name="System.ServiceModel"
       switchValue="Verbose,ActivityTracing">
          <listeners>
               <add name="xmlListener" />
          </listeners>
     </source>
</sources>

 

Answer:

D.

<sources>
     <source name="System.ServiceModel"
       switchValue="Verbose,ActivityTracing">
          <listeners>
               <add name="xmlListener" />
          </listeners>
     </source>
</sources>

 

Tutorial:

To trace the service activities to debug and optimize its operations using the specified listener, you should add the following setting to the configuration file:

<sources>
     <source name="System.ServiceModel"
       switchValue="Verbose,ActivityTracing">
          <listeners>
               <add name="xmlListener" />
          </listeners>
     </source>
</sources>

The name attribute of the of the source element is used to specify the trace source that is to be used for trace logging. The trace source type System.ServiceModel is used to log all aspects of WCF processing, such as message processing and reading a configuration file. The switchValue attribute of the source element is used to specify the tracing level of the trace source. The trace level is set to Verbose to specify that the tracing should be done for all the events, including informational events. This level of tracing generally is used for debugging purposes or for optimizing the performance of an application. The switchValue attribute can be set to ActivityTracing to specify that tracing should be done for all flow events, including tracing for activity boundaries and endpoint transfers.

The Listeners section of the source element is used to specify the type and name of the trace listener. You can use the add attribute of the listeners element to specify the name of the listener.

Tracing can be used to capture and view WCF communication and infrastructure events. You can use tracing for events such as operation calls, code exceptions and transaction stages. You can use the SvcTraceViewer tool to view the trace output. The source trace can be configured either in the configuration file or in the code. WCF provides a trace source for each of the WCF assemblies. The trace sources determine the event types as follows:

 

  • System.ServiceModel: Logs all transport and security events in WCF processing.
  • System.ServiceModel.MessageLogging: Logs all messages send between WCF hosts.
  • System.ServiceModel.Activation: Logs activation and creation events associated with a WCF service.
  • System.IO.Log: Logs all events in the event log.
  • System.Runtime.Serialization: Logs when objects are serialized or de-serialized.

 

1 | 2 | 3 | 4 | 5 |
Viewed 11109 times.
SPONSORED LINKS
gps systems used