You create an XML Web service that uses the Trace class to output error messages, warning messages, and informational messages to a log file. The service uses a TraceSwitch object to filter the trace output.The DisplayName property of the TraceSwitch object is "globalSwitch". On a development 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 We
B.config file, add the following code segment:
C.To the Web.config file, add the following code segment:
D.To the Web.config file, add the following code segment:
试卷相关题目
- 1You create an XML Web service named Servicel. You use the Debug. Assert method in your code to verify parameter values and ranges.You find that Servicel does not display assertion failure messages. Instead, Servicel returns an HTTP 500 error message when an assertion fails. You want to view the assertion failure messages.What should you do?
A.Modify the We
B.config file to stop the Debug.Assert method from displaying a message boxB.Modify the compilation element of the Web.config file by setting the debug attribute to "True"
C.In the constructor for Servicel, set the Debug.AutoFlush property to False
D.In the constructor for Servicel, add an EventLogTraceListener object to the Listeners property of the Debug class
开始考试点击查看答案 - 2You create a Windows service that processes XML messages placed in a MSMQ queue. You discover that the service is not functioning properly.You need to debug the service to correct the program.What should you do?
A.Start the Windows service. Then attach a debugger to the process
B.Attach a debugger to the Windows service. Then start the Windows service
C.Start the Windows service. Then run the .NET Services Installation Tool(Regsvsc.exe)
D.Place a breakpoint in the Main method of the Windows servic
E.Then run the application within the Visual Studio .NET integrated development environment(IDE)
开始考试点击查看答案 - 3You have a strongly typed object named myDataSet. This objectcontains two DataTable objects named Categories and Products.Categories has a data column named CategoryID. Products has two datacolumns named CategoryID and ProductID.Categories has a primary key named CategoryKey on CategoryID.Products has a primary key named ProductKey on ProductID.You want to add a foreign key constraint on CategoryID column betweenCategories and Products.Which code segment should you use?
A.
B.
C.
D.
开始考试点击查看答案 - 4You develop an application named myApp. This application needs to run on the same computer as a Windows service named myService.You want to ensure that myService starts from myApp if myService is not already running.Which code segment should you use?
A.Dim myServiceController As New ServiceController("myService")If myServiceController.Status = _ServiceControllerStatus.Stopped Then myServiceController.Start()End If
B.Dim myServiceController As New _ServiceController("myService") myServiceController.Start ()C . Dim myArgs(1) As StringmyArgs(0)="myService"Dim myServiceController As New _ServiceController ()If myServiceController.Status = ServiceControllerStatus. Stopped _Then myServiceController.Start(myArgs)End IfD. Dim myArgs(0) As String myArgs(0)= "myService"Dim myServiceController As New _ServiceController ()myServiceController . Start (rnyArgs)
开始考试点击查看答案 - 5You create a class named User that provides user information from a variety of data sources. Different instances of User connect to different data sources to load the dat
A.User is a read-only representation of user information and does not support written changes back to a data source.The User class includes the following code segment:
Public Class UserPublic Sub New(String connectionstring)Me.connectionstring =* connectionstring 'Additional construction code goes here.End SubFriend Readonly Property ConnectionString() As String GetReturn connectionstringEnd GetEnd PropertyPrivate connectionstring As String 'Other methods and properties go here.End ClassOnce a User object has been populated, it no longer needs the connectionstring member variable.You have a .NET Remoting object named Project that returns User objects. You want to prevent remote client applications from being able to view the content of the connectionstring member variable.What should you do?A.Make the Connectionstring property private B.Remove the connectionstring parameter from the constructor
C.Add the NonSerialized attribute to the Connectionstring property
D.Add the NonSerialized attribute to the connectionstring member variable
开始考试点击查看答案 - 6You create an XML Web service named LatLong that converts street addresses to latitude and longitude coordinates. Your company charges for this service and allows only existing customers to use the service.If a customer is not passed as part of a SOAP header, you want the service to refuse the request. You want these service refusal messages to be logged to an event log named LatLongLog. You anticipate that there will be a lot of these log entries over time. A string object named refusalMessage contains the message to log.Which code segment should you use?
A.Dim log As New EventLog("LatLongLog")log.WriteEntry(refusalMessage, EventLogEntryType.Error)
B.Dim log As New EventLog("LatLongLog") log.Source = "LatLongLog"log.WriteEntry(refusalMessage, EventLogEntryType.Error)C . If Not EventLog.SourceExists("LatLongSource") ThenEventLog.CreateEventSource("LatLongSource", "LatLongLog") End IfEventLog.WriteEntry("LatLongSource", refusalMessage, EventLogEntryType .Error)D. If Not EventLog.SourceExists("LatLongSource") ThenEventLog.CreateEventSource ("LatLongSource", "LatLongLog") End IfDim log As New EventLog ("LatLongLog")log.WriteEntry(refusalMessage, EventLogEntryType.Error)
开始考试点击查看答案 - 7You are creating an XML Web service named BankCustomer that provides customer information. You write code to keep track of error messages, warning messages, and informational messages while the service is running. You use the Trace class to write the messages to a log file.On test computers, you want to see error messages and warning messages . On deployment computers, you want to see error messages, but not warning messages.Which code segments should you use? (Each correct answer presents part of the solution. Choose two)
A.Private mySwitch As New TraceSwitch Sub BankCustomermySwitch = New TraceSwitch ("tswitch", "a trace switch") End Sub
B.Public Shared level As New TraceLevel Sub BankCustomerlevel = TraceLevel.ErrorEnd SubC . Trace.WriteLinelf(mySwitch.TraceError,"An error occurred.")Trace.WriteLinelf(mySwitch.TraceWarning,"Warning message")D. Trace.WriteLinelf (level = TraceLevel.Error,"The operation succeeded.u)Trace.WriteLinelf(level = TraceLevel.Warning,"Warning message")E . Trace.WriteLinelf(mySwitch <> Nothing,"An error occurred.")Trace.WriteLinelf(mySwitch <> Nothing,"Warning Message")F.Trace.Writelf(level <> TraceLevel.Off,"An error occurred.")Trace.Writelf(level <> TraceLevel.Off,"Warning Message")
开始考试点击查看答案 - 8You create an XML Web service named Servicel that exposed your company's inventory dat
A.This data is used by other companies to place orders. Servicel must conform to existing formatting standards for inventory data.You deploy Servicel. You discover that some client applications arerejecting your XML formatting because the XML is inconsistent with the expected standard. You want to debug this problem by tracing the XML responses.What should you do?A.In the We
B.config file, enable tracing by setting the enabled attribute of the trace element to "true"B.Inside each Web method, use the Debug class to write the contents of the inherited Context.Response property to a log file
C.Create a SOAP extension to log the SoapMessageStage. Af- terSerialize output to a log file
D.You want to debug this problem by tracing the XML responses.What should you do?A.In the Web.config file, enable tracing by setting the enabled attribute of the trace element to "true"B.Inside each Web method, use the Debug class to write the contents of the inherited Context.Response property to a log fileC.Create a SOAP extension to log the SoapMessageStag
E.Af- terSerialize output to a log fileD.On each Web method, use the SoapHeader attribute to map all SOAP headers to a member variable for the Servicel class. Then use the Trace.WriteLine method to log the headers to a log file
开始考试点击查看答案 - 9You create a serviced component named SessionDispenser. This component is in the Fabrikam.Utilities assembly and is registered in a COM+ server application. SessionDi spenser has multiple callers .You discover that there are logic problems in the Create New Session method. You want to debug any calls to this method.What should you do?
A.Open the Session Dispenser solution. Set a breakpoint on theCreateNewSession method. Start the debugger
B.Attach the debugger to the client process. Set a breakpoint on the SessionDispenser.CreateNewSession methodC . Attach the debugger to the Fabrikam.Utilites . exe process . Set a breakpoint on the CreateNewSession methodD. Attach the debugger to a Dllhost.exe process. Set a breakpoint on the CreateNewSession method
开始考试点击查看答案 - 10You create a collection of serviced components that performs bank transfers. All the components are marked with the Transaction (TransactionOption.Required) attribute. All the methods in the components are marked with the AutoComplete () attribute.You discover that incorrect balance amounts are being transferred. You decide to debug the components. During debugging, a System. Runtime.InteropServices.COMException is thrown. The HRESULT for the exception is Ox8004EOO2. The exception includes the following message: "The root transaction wanted to commit but transaction aborted."You find that this exception occurs only during the debugging session, and not when the components run outside of the debugger. This exception is preventing you from continuing to debug the components . You need to resolve this problem.What should you do?
A.Remove the AutoComplete attribute from each method.Within each method implementation, add calls to the Con- textUtil.SetComplete() and ContextUtil.SetAbort() methods
B.Remove the AutoComplete attribute from each method.Within each method implementation, add calls to the ContextUtil .MyTransactionVote and ContextUtil, DeactivateOn- Return properties
C.Increase the transaction timeout in the Component Services tool by using the Properties dialog box for My Computer
D.Within each method implementation, add calls to the Con- textUtil.SetComplete() and ContextUtil.SetAbort() methodsB.Remove the AutoComplete attribute from each method.Within each method implementation, add calls to the ContextUtil .MyTransactionVote and ContextUtil, DeactivateOn- Return propertiesC.Increase the transaction timeout in the Component Services tool by using the Properties dialog box for My ComputerD.Replace each method implementation with the following segment:Try'Existing method body goes her
E.FinallyContextUtil.SetComplete ()End Try
开始考试点击查看答案