computer, all trace output appears in the log file. You move the service to a production computer. You must configure the production XML Web service to output only error messages to the log file. What should you do?A. To the Web.config file, add the following code segment: <system.diagnostics> <switches> <add name=”XYZSwitch” value=”1” /> </switches> </system.diagnostics> B. To the Web.config file, add the following code segment: <system.diagnostics> <switches> <add name=”XYZSwitch” value=”TraceSwitch” /> </switches> </system.diagnostics> C. To the Web.config file, add the following code segment: <system.diagnostics> <switches> <add name=”TraceSwitch” value=”1” /> </switches> </system.diagnostics> D. To the Web.config file, add the following code segment:.<system.diagnostics> <switches> <add name=”TraceSwitch” value=”XYZSwitch” /> </switches> </system.diagnostics> Answer: A Explanation: In the Web.config file we should specify the name of the switch (XYZSwitch) and the appropriate Tracelevel through the value attribute.Tracelevel corresponds to the values 1 through 4. Tracelevel 1 only displays error messages. Note: A switch provides an efficient mechanism for controlling tracing and debugging output at run time using external settings. The Switch class implements default behavior for switches, allowing you to change the switch level at run time. Reference: .NET Framework Class Library, Switch Class [Visual Basic] Visual Basic and Visual C# Concepts, Trace Switches Incorrect AnswersB: Incorrectly the value attribute is set to “TraceSwitch”. Valid Tracelevel values are 1 through 4.C, D: We should specify the name of the switch with a name attribute in the Web.config file. We must specify XYZSwitch, not TraceSwitch.
Exam Name: Developing XML Web Services & Server Components with MS Visual Basic .NET Exam Type: Microsoft Exam Code: 70-310 Total Questions: 223 Page 68 of 151 Question: 87 You create an XML Web service named PhoneNumberService that returns the telephone numbers of people in a specified geographical region. If an error occurs when the service is processing requests, a custom application exception named PhoneNumberException is thrown. You create an ASP.NET application named EXPhoneBook that contains a Web reference to PhoneNumberService. You need to wrap any calls made to PhoneNumberService in a try/catch block to catch any PhoneNumberException that may be thrown. Which two code segments are possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two)

You've reached the end of your free preview.
Want to read all 151 pages?
- Spring '16
- .NET Framework, Microsoft Visual Studio