XML Web Services and Server Components with Visual Basic.NET
Index >> Microsoft >> MCAD.NET >> "70-310"Exam
VUE/Prometric Code:70-310
Questions and Answers:187 Q&As
Price:$49
Updated:2008-11-12
| XML Web Services and Server Components with Visual Basic.NET | |||
| Test | Q&A | Updated | Price |
| 70-310 | 187 Q&A | 2008-11-12 | $49 |
please download in PDF format Demo:
killtest 70-310 Exam Features
High quality and Value for the 70-310 Exam.
Killtest Practice Exams for XML Web Services and Server Components with Visual Basic.NET 70-310 are written to the highest standards of technical accuracy, using only certified subject matter experts and published authors for development.
100% Guarantee to Pass Your MCAD.NET exam and get your MCAD.NET Certification.
We guarantee your success in the first attempt. If you do not pass the 70-310 (XML Web Services and Server Components with Visual Basic.NET) on your first attempt we will give you a FULL REFUND of your purchasing fee AND send you another same value product for free.
killtest 70-310 Downloadable.
Printable Exams (in PDF format) Our Exam 70-310 Preparation Material provides you everything you will need to take your MCAD.NET exam. The MCAD.NET Certification details are researched and produced by Professional Certification Experts who are constantly using industry experience to produce precise, and logical. You may get MCAD.NET exam questions from different web sites or books, but logic is the key. Our Product will help you not only pass in the first MCAD.NET exam try, but also save your valuable time .
- Comprehensive questions with complete details about 70-310 exam.
- 70-310 exam questions accompanied by exhibits.
- Verified Answers Researched by Industry Experts and almost 100% correct.
- Drag and Drop questions as experienced in the Real MCAD.NET exam.
- 70-310 exam questions updated on regular basis.
- Like actual MCAD.NET Certification exams, 70-310 exam preparation is in multiple-choice questions (MCQs).
- Tested by many real MCAD.NET exams before publishing.
- Try free MCAD.NET exam demo before you decide to buy it in http://www.Killtest.com.
High quality and Value for the 70-310 Exam:100% Guarantee to Pass Your MCAD.NET exam and get your MCAD.NET Certification.
http://www.Killtest.com The safer.easier way to get MCAD.NET Certification.
We offer Demo version of Q&A, Q&A are as follows (not to provide picture):
70-310:please download 70-310 in PDF format Demo 
1.You 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 0x8004E002. 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 ContextUtil.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.DeactivateOnReturn properties.
C. Increase the transaction timeout in the Component Services tool by using the Properties dialog box for My Computer.
D. Replace each method implementation with the following code segment: Try ' The original method implementation goes here. Finally ContextUtil.SetComplete() End Try
Answer: C
2.You create a .NET Remoting object named MyRemoteObject in an XML Web service named MyWebService. All method calls made on MyRemoteObject are routed to a single instance of this object. The state of MyRemoteObject must be maintained between method calls. You need to register MyRemoteObject as a well-known object provided by MyWebService. You want to accomplish this goal by adding code to the Web.config file of MyWebService. Which code segment should you use?
A. <wellknown mode="Singleton" type="MyRemoteObject, MyWebService" objectUri="MyWebService.rem" />
B. <wellknown mode="Singleton" type="MyWebService.MyRemoteObject, MyWebService" objectUri=
"MyRemoteObject.rem" />
C. <wellknown mode="SingleCall" type="MyRemoteObject, MyWebService" objectUri="MyWebService.rem"/>
D. <wellknown mode="SingleCall" type="MyWebService.MyRemoteObject, MyWebService"objectUri="MyRemoteObject.rem" />
Answer: B
3.You are using Visual Studio .NET to develop an application that uses a non-COM DLL named UsefulFunctions.dll. This DLL is written in unmanaged code. The DLL contains a function that parses a string into an array of string words and an array of numbers. A call to the function includes the following pseudocode:
input = "A string with 6 words and 2 numbers" words = Nothing numbers = Nothing Parse(input, words, numbers) After execution, words contains all string words found in input and numbers contains all integers found in input.You need to enable your application to call this function. Which code segment should you use?
A. Declare Function Parse Lib "UsefulFunctions.dll" _
(ByVal input As String, ByVal words() As String, ByVal numbers() As Integer) As Integer
B. Declare Function Parse Lib "UsefulFunctions.dll" _
(ByVal input As String, ByRef words() As String, ByRef numbers() As Integer) As Integer
C. Declare Function Parse Lib "UsefulFunctions.dll" _
(ByRef input As String, ByVal words() As String, ByVal numbers() As Integer) As Integer
D. Declare Function Parse Lib "UsefulFunctions.dll" _
(ByRef input As String, ByRef words() As String, ByRef numbers() As Integer) As Integer
Answer: B
4.You create a serviced component named Tracker that uses attributes to dynamically register itself for COM+ services. Tracker is in an assembly file named Fabrikam.dll. Tracker uses transactions and role-based security. The roles and the application identity for Tracker are configured on the development computer. You are preparing to
hand off Tracker to an administrator for deployment to production computers. You want all the COM+ configuration information for Tracker to be installed on the production computers. What should you do?
A. Use the Component Services tool to export Tracker to an .msi file. Provide to the administrator the .msi file with instructions to run the installer.
B. Provide to the administrator the Fabrikam.dll file. Instruct the administrator to copy Fabrikam.dll to all production computers and to install it in the global assembly cache.
C. Provide to the administrator the Fabrikam.dll file. Instruct the administrator to use the .NET Services Installation tool (Regsvcs.exe) to install Tracker.
D. Add a new merge module to your solution. Add Fabrikam.dll to the merge module. Provide to the administrator the .msm file with installation instructions.
Answer: A
5.You create a .NET Remoting object named Time. The Time class is in the Utils namespace and is in an assembly file named Fabrikam.dll. The Time class is hosted in an Internet Information Services (IIS) virtual directory named UtilsSvr. The Time class is configured to be a server-activated object and uses a URI named Time.rem.
You use a client application named Test.exe to test the Time object. Test.exe creates instances of the Time object by using the following method signature:
Public Function CreateInstance() As Time RemotingConfiguration.Configure("Test.exe.config")
Return new Time() End Function You want Test.exe to create instances of the Time class on a computer named Hosting. What should you do?
A. Create a Test.exe.config file that includes the following code segment:
<configuration> <system.runtime.remoting>
<application> <client>
<wellknown type="Utils.Time, Fabrikam"
url="tcp://Hosting:80/UtilsSvr/Time.rem"/>
</client> </application>
</system.runtime.remoting> </configuration>
B. Create a Test.exe.config file that includes the following code segment:
<configuration> <system.runtime.remoting>
<application> <client>
<wellknown type="Utils.Time, Fabrikam"
url="http://Hosting/UtilsSvr/Time.rem"/>
</client> </application>
</system.runtime.remoting> </configuration>
C. Create a Test.exe.config file that includes the following code segment:
<configuration> <system.runtime.remoting>
<application>
<client url="http://Hosting/UtilsSvr/Time.rem">
<activated type="Utils.Time, Fabrikam"/>
</client> </application>
</system.runtime.remoting> </configuration>
D. Create a Test.exe.config file that includes the following code segment:
<configuration> <system.runtime.remoting>
<application>
<client url="tcp://Hosting:80/UtilsSvr/Time.rem">
<activated
type="Utils.Time, Fabrikam"/>
</client> </application>
</system.runtime.remoting> </configuration>
Answer: B
6.You are creating an XML Web service named WeatherService that provides the current weather conditions for cities around the world. Your development cycle includes three stages: development, testing, and production. In each stage, WeatherService will be deployed on a different server. For testing, you create an ASP.NET application
named WeatherTest. To WeatherTest, you add a Web reference to WeatherService. You then build a user interface and add the necessary code to test the service. The WeatherService interface will not change between testing and deployment. You want to ensure that you do not have to recompile WeatherTest every time WeatherService is
moved from one server to another. What should you do?
A. Each time WeatherService is moved, set the URL property of the generated proxy class to the new location.
B. Each time WeatherService is moved, set the Web Reference URL property of the generated proxy class to the new location.
C. Set the URLBehavior property of the generated proxy class to dynamic. Each time WeatherService is moved, update the appropriate key in the Web.config file to indicate the new location.
D. Take the location of WeatherService as input to WeatherTest, and set the Proxy property of all proxy class instances to that location.
Answer: C
7.You are creating an XML Web service named InventoryService for a nationwide clothing retailer. The service provides near real-time inventory information to individual store managers by using a virtual private network (VPN). InventoryService exposes a Web method named RetrieveInventory that returns inventory information to the caller. You configure Internet Information Services (IIS) and InventoryService to use Integrated Windows authentication. You need to write code in InventoryService to ensure that only members of the Manager group can access RetrieveInventory. What should you do?
A. To the section of the Web.config file, add the following element:
B. To the section of the Web.config file, add the following element:
C. In RetrieveInventory, add the following code segment: If User.Identity.Name.Equals("Manager") Then ' Code to retrieve inventory data goes here. End If
D. In RetrieveInventory, add the following code segment: If User.Identity.AuthenticationType.Equals("Manager")
_ Then ' Code to retrieve inventory data goes here. End If
Answer: A
8.Your Microsoft SQL Server database has a stored procedure named GetCompanyName. GetCompanyName accepts one parameter named @CustomerID and returns the appropriate company name. You instantiate a SqlCommand object named myCommand. You need to initialize myCommand to return the company name for
@CustomerID with a value of "ALFKI". Which code segment should you use?
A. myCommand.CommandText = "GetCompanyName, ALFKI" myCommand.Parameters.Add("@CustomerID")
B. myCommand.CommandText = "GetCompanyName" myCommand.Parameters.Add("GetCompanyName",
"ALFKI")
C. myCommand.CommandText = "@CustomerID" myCommand.Parameters.Add("GetCompanyName",
"ALFKI")
D. myCommand.CommandText = "GetCompanyName" myCommand.Parameters.Add("@CustomerID",
"ALFKI")
Answer: C
9.You are creating data access components for an XML Web service that retrieves data from a Microsoft SQL Server database. The components use the SqlClient data provider. You estimate that an average of 10 users will use the service concurrently. Therefore, you want to maintain at least 15 database connections at all times. What should you do?
A. Set the Packet Size property of the connectionString to 15.
B. Set the Max Pool Size property of the connectionString to 15.
C. Set the Min Pool Size property of the connectionString to 15.
D. Set the Connection Lifetime property of the connectionString to 15.
Answer: C
10.You have a DataSet object that contains a single DataTable object named Employees. Employees has a column named EmployeeID. EmployeeID contains no duplicate data. You are creating a function that accepts a parameter of EmployeeID and searches Employees to return the DataRow object for the specified EmployeeID. You want to
use the Find method of the rows collection in Employees to return the requested DataRow object from the function. You need to ensure that you can use the Find method to accomplish this goal. What should you do?
A. Ensure that EmployeeID is the first column in Employees.
B. Ensure that EmployeeID is unique for each row in Employees.
C. Ensure that Employees has a primary key on EmployeeID.
D. Ensure that Employees is sorted in ascending order on EmployeeID.
Answer: C
11.You create an XML Web service that calculates taxes. You deploy the service to a production computer named Production. The URL of the production XML Web service is http://Production/WS/TaxCalc.asmx. The service does not support all international tax rates. You want to find out which unsupported tax rates are being requested
by users. If a user requests a tax rate that is not supported, the service records the request by using a trace message. You want to view the unsupported rates that have been requested. Which two actions should you take? (Each correct answer presents part of the solution. Choose two.)
A. Modify the trace element in the Web.config file of the service by setting the pageOutput attribute to "true".
B. Modify the trace element in the Web.config file of the service by setting the enabled attribute to "true".
C. To the constructor of the TaxCalc class, add the following code segment:
Public Sub New()
InitializeComponent() Trace.AutoFlush = True End Sub
D. To the constructor of the TaxCalc class, add the following code segment:
Public Sub New()
InitializeComponent() Trace.Flush() End Sub
E. View the page at http://Production/WS/TaxCalc.asmx.
F. View the page at http://Production/WS/Trace.axd.
Answer: BF
12.You create an XML Web service that uses an existing COM component. You implement the service so that it does not return COM exceptions to its callers. Instead, the service translates the COM exceptions into more specific exception types based on the HRESULT, as shown in the following code segment: Try ' Code to call the COM component goes here. Catch ce As COMException Select Case ce.ErrorCode
Case &H80070005 Throw New SecurityException("Access denied", ce) ' Additional case statements go here.End Select End Try You want to record the original COM exception that was thrown. What should you do?
A. At the beginning of the catch block, add the following code segment:
Console.WriteLine("{0}
COMException caught.", ce)
B. At the beginning of the catch block, add the following code segment:
Context.Trace.Write(ce,
"COMException caught.")
C. Within each case statement, add the following code segment:
ce.ToString()
D. Within each case statement, add the following code segment:
Console.WriteLine("{0} COMException
caught.", ce.StackTrace)
Answer: B
13.You create a serviced component named TransferUtil to transfer money between bank accounts. TransferUtil logs information for failed transfers by using the Trace class. You want TransferUtil to save these log messages.Which code segment should you use?
A. Shared Sub New() Trace.Flush() End Sub
B. Shared Sub New() Trace.Listeners.Clear() End Sub
C. Shared Sub New() Trace.Listeners.Add( _ new TextWriterListener("transfer.log")) End Sub
D. Protected Overloads Overrides Sub Finalize() Trace.Flush() End Sub
E. Protected Overloads Overrides Sub Finalize() Trace.Listeners.Clear() End Sub
F. Protected Overloads Overrides Sub Finalize() Trace.Listeners.Add( _ new TextWriterListener("transfer.log")) End Sub
Answer: C
14.You are creating an XML Web service named BankCustomer that provides bank 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 two code segments should you use? (Each correct answer presents part of the solution. Choose two.)
A. Public Shared mySwitch as TraceSwitch Shared Sub New() mySwitch = new TraceSwitch("tswitch", _ "a trace switch") End Sub
B. Public Shared level as TraceLevel Shared Sub New() level = TraceLevel.Error End Sub
C. Trace.WriteLineIf(mySwitch.TraceError, _ "An error occurred.") Trace.WriteLineIf(mySwitch.TraceWarning, _ "Warning message")
D. Trace.WriteLineIf(level = TraceLevel.Error , _ "The operation succeeded.") Trace.WriteLineIf(level = TraceLevel.Warning, _ "Warning message")
E. Trace.WriteLineIf(Not mySwitch Is Nothing, _ "An error occurred.") Trace.WriteLineIf(Not mySwitch Is Nothing, _ "Warning message")
F. Trace.WriteLineIf(level <> TraceLevel.Off, _ "An error occurred.") Trace.WriteLineIf(level <> TraceLevel.Off, _ "Warning message")
Answer: AC
15.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 Web.config file, add the following code segment:
<system.diagnostics>
<switches>
<add name="globalSwitch" value="1" />
</switches>
</system.diagnostics>
B. To the Web.config file, add the following code segment:
<system.diagnostics>
<switches>
<add name="globalSwitch" 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="globalSwitch" />
</switches>
</system.diagnostics>
Answer: A
16.You are creating a .NET Remoting object. You want to add code to the object to log error messages and warning messages. You want the log messages written to both a log file and to the Windows application log.Which code segment should you use?
A. Dim eventLog As New EventLog("remobj") Dim fileLog As FileStream = File.Create("remobj.log")
Trace.WriteLine(eventLog, "sample message") Trace.WriteLine(fileLog, "sample message")
B. Dim eventLog as New EventLog("remobj") Dim fileLog As FileStream = File.Create("remobj.log")
Trace.Write(eventLog) Trace.Write(fileLog) Trace.WriteLine("sample message")
C. Trace.Listeners.Add(new
EventLogTraceListener("remobj"))
Trace.Listeners.Add(
_
new
TextFileTraceListener("remobj.log")) Trace.WriteLine("sample message")
D.Trace.Listeners.Add(new
EventLogTraceListener())
Trace.Listeners.Add(
_
new
TextFileTraceListener("remobj.log")) Trace.WriteLine("sample message")
Answer: C
17.You are creating an XML Web service named Tracker to track orders for your company. Tracker includes a Web method named OrderStatus for tracking the status of individual orders. You anticipate that many client applications will use the service. You want administrators of Tracker to be able to monitor the requests per second for OrderStatus. Which code segment should you use?
A. Dim counter As New PerformanceCounter("Tracker", _ "OrderStatus req/sec", False)
B. PerformanceCounterCategory.Create("Tracker", _ "category", "OrderStatus req/sec", "req/sec")
C. Dim counterData() As CounterCreationData = _ {New CounterCreationData("OrderStatus req/sec", "help",
PerformanceCounterType.RateOfCountsPerSecond32)}
Dim
collection
As
New
_
CounterCreationDataCollection(counterData) PerformanceCounterCategory.Create("Tracker", _ "Tracker
performance counters", collection)
D. Dim counterData() As CounterCreationData = _
{New CounterCreationData("Int32", "second", _
PerformanceCounterType.AverageTimer32)}
Dim collection As New _
CounterCreationDataCollection(counterData) PerformanceCounterCategory.Create("OrderStatus", _
"requests per second", collection)}
Answer: C
18.You write a serviced component named OrderProcessing that processes customer orders. You cache the product list and customer list within OrderProcessing to improve response time. OrderProcessing has a method named ValidateCache that validates the contents of the cache. ValidateCache includes the following method signature:
Public Sub ValidateCache(ByVal name as String) You want to call ValidateCache during development and testing. You do not want to call ValidateCache when you release your component for deployment. You want to accomplish this task by writing the minimum amount of code. Which code segment should you use?
A. Public Sub ValidateCache(ByVal name as String) Debug.Assert(False) ' Method body goes here. End Sub
B. #If DEBUG Then Public Sub ValidateCache(ByVal name as String) ' Method body goes here. End Sub #End If
C. _ Public Sub ValidateCache(ByVal name as String) ' Method body goes here. End Sub
D. _ Public Sub ValidateCache(ByVal name as String) ' Method body goes here. End Sub
Answer: D
19.You create a strongly named serviced component. The component uses a third-party .NET assembly named Fabrikam.Encryptor.dll to perform encryption and decryption. Fabrikam.Encryptor.dll is registered in the global assembly cache. You deploy the serviced component and Fabrikam.Encryptor.dll to a production computer. A new
version of Fabrikam.Encryptor.dll becomes available. You remove the original version and install the new version on the production computer. The serviced component throws a System.TypeLoadException when it attempts to use Fabrikam.Encryptor.dll. You need to correct this problem. What should you do?
A. Unregister and then re-register the serviced component in the global assembly cache.
B. Use the Strong Name tool (Sn.exe) to create a new key file for the serviced component.
C. Create a configuration file named Dllhost.exe.config to redirect the serviced component to the new version of Fabrikam.Encryptor.dll.
D. Create a publisher policy assembly for Fabrikam.Encryptor.dll and register the assembly in the global assembly cache.
Answer: C
20.You create an XML Web service named PostalCode. Your project source includes a code-behind file and a file named PostalCode.asmx. During implementation, you use the Debug class to record debugging log messages, to verify parameter values, and to report debugging failures. You want to deploy PostalCode to a production computer. You do not want any of the debugging code to execute on the production computer. What should you do?
A. Set the projec’s active configuration to Release and rebuild the DLL.
B. Modify the trace element of the Web.config file by setting the enabled attribute to "false".
C. Modify the compilation element of the Web.config file by setting the debug attribute to "false".
D. Add code to the constructor of the PostalCode class to set the AutoFlush property of the Debug class to false.
E. Add code to the constructor of the PostalCode class to call the Clear method of the Debug.Listeners property.
Answer: C
21.You create an XML Web service named Service1. You use the Debug.Assert method in your code to verify parameter values and ranges. You find that Service1 does not display assertion failure messages. Instead, Service1 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 Web.config file to stop the Debug.Assert method from displaying a message box.
B. Modify the compilation element of the Web.config file by setting the debug attribute to "true".
C. In the constructor for Service1, set the Debug.AutoFlush property to false.
D. In the constructor for Service1, add an EventLogTraceListener object to the Listeners property of the Debug class.
Answer: A
22.You create a Windows service named FxListener that performs financial transactions by using files in a drop directory. When a new XML file appears in the drop directory, FxListener opens the file and performs the financial transaction contained within the XML code. You want updates to each XML file to be logged in the Windows application log. A String object named myMessage contains the message to be logged. Which code
segment should you use?
A. EventLog.WriteEntry("FxListener", myMessage)
B. Dim log As New EventLog("Application") log.WriteEntry(myMessage)
C. Dim log As New EventLog("Application") Trace.WriteLine(log, myMessage)
D. Dim log As New EventLog("FxListener") log.Source = "Application" log.WriteEntry(myMessage,
EventLogEntryType.SuccessAudit)
Answer: A
23.You 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 ID 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() log.Source = "LatLongLog" log.WriteEntry(refusalMessage,
EventLogEntryType.Error)
C. If Not EventLog.SourceExists("LatLongSource") Then EventLog.CreateEventSource("LatLongSource", _
"LatLongLog") End If EventLog.WriteEntry("LatLongSource", refusalMessage, EventLogEntryType.Error)
D. If Not EventLog.SourceExists("LatLongSource") Then EventLog.CreateEventSource("LatLongSource", _
"LatLongLog") End If Dim log As New EventLog("LatLongLog") log.WriteEntry(refusalMessage,
EventLogEntryType.Error)
Answer: C
24.You create an XML Web service named TimeService. Each time TimeService is started, it checks for the existence of an event log named TimeServiceLog. If TimeServiceLog does not exist, TimeService creates it. You discover that when TimeService creates TimeServiceLog, it throws a System.Security.SecurityException. The exception includes the following message: "Requested registry access is not allowed." You need to resolve this problem. What should you do?
A. Configure Inetinfo.exe to run as the local administrator user account.
B. Create an installer for TimeService, and create the new event log in the installer code.
C. Modify the Web.config file by adding an identity element to impersonate the LOGON user specified by Internet Information Services (IIS).
D. Modify the permissions for the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog
registry key to give full control to the IUSR_computername user account.
Answer: B
25.You create a serviced component named SessionDispenser. This component is in the Fabrikam.Utilities assembly and is registered in a COM+ server application. SessionDispenser has multiple callers. You discover that there are logic problems in the CreateNewSession method. You want to debug any calls to this method. What
should you do?
A. Open the SessionDispenser solution. Set a breakpoint on the CreateNewSession method. Start the debugger.
B. Attach the debugger to the client process. Set a breakpoint on the SessionDispenser.CreateNewSession method.
C. Attach the debugger to the Fabrikam.Utilities.exe process. Set a breakpoint on the CreateNewSession method.
D. Attach the debugger to a Dllhost.exe process. Set a breakpoint on the CreateNewSession method.
Answer: D
26.You create an XML Web service named Service1 that exposes your company's inventory data. This data is used by other companies to place orders. Service1 must conform to existing formatting standards for inventory data.You deploy Service1. You discover that some client applications are rejecting 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 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 file.
C. Create a SOAP extension to log the SoapMessageStage.AfterSerialize output to a log file.
D. On each Web method, use the SoapHeader attribute to map all SOAP headers to a member variable for the Service1 class. Then use the Trace.WriteLine method to log the headers to a log file.
Answer: C
27. You create a serviced component named BankAdmin. The component exposes administrative methods for a banking application. BankAdmin uses role-based security and is only accessible by users in the Admin role. The BankAdmin class includes the following code segment: Public Class BankAdmin Inherits ServicedComponent' Methods for BankAdmin go here. End Class
You deploy BankAdmin to a test computer. You use a test application that runs on the test computer under a local machine account named Tester. The Tester account is a member of the Users and Debugger Users groups. When the test application calls BankAdmin, a System.UnauthorizedAccessException is thrown. The exception includes
the following message: "Access is denied." You want the test application to have access to BankAdmin. Which action or actions should you take? (Choose all that apply.)
A. Add the Tester account to the local Administrators group.
B. Add a role named Tester by using the Component Services tool.
C. Add the Tester account to the Admin role by using the Component Services tool.
D. To the beginning of each BankAdmin method, and the following code segment: If
ContextUtil.IsCallerInRole("Admin") Then ' Original method body goes here. End If
E. To the beginning of each BankAdmin method, and the following code segment: Dim context As SecurityCallContext context = SecurityCallContext.CurrentCall If context.IsUserInRole("Admin", "Tester") Then ' Original method body goes here. End If
Answer: C
28.You create a serviced component named OrderProcessor. OrderProcessor implements the IOrderInit interface.The component and the interface contain the following code segments:
_ Public Interface IOrderInit ' IOrderInit methods go here. End Interface
Public Class OrderProcessor Inherits ServicedComponent Implements IOrderInit ' OrderProcessor methods go here. End Class You discover that every time you rebuild OrderProcessor, existing unmanaged client code fails. The HRESULT for the exception is 0x80040154. The exception includes the following message: "Class not registered." You need to resolve this problem. What should you do?
A. Add a Guid attribute to the OrderProcessor class.
B. Add a ComImport attribute to the IOrderInit interface.
C. To the OrderProcessor class, add the following attribute: ClassInterface(ClassInterfaceType.AutoDual)
D. To the end of every method, add the following line of code: Marshal.ReleaseComObject(Me)
Answer: A
29. You create a .NET Remoting object named AdminService, which is hosted in Internet Information Services (IIS). The object uses an HttpChannel and a BinaryFormatter.
AdminService is in an assembly named AdminService.dll. The URL for AdminService is
http://LocalHost/AdminService/AS.rem. You write a test console application named Tester.exe to test the AdminService interface. Tester.exe includes the
following code segment:
Module Tester
Sub Main()
Dim service As New AdminService()
End Sub
End Module
You write a configuration file for Tester.exe. The configuration file is named Tester.exe.config and includes the
following code segment:
<configuration>
<system.runtime.remoting>
<application>
<client>
<wellknown
url="http://LocalHost/AdminService/AS.rem"
type="AdminService, AdminService"
/>
</client>
</application>
</system.runtime.remoting>
</configuration>
You run Tester.exe. The application immediately throws a System.NullReferenceException. The exception includes the following message: "Object reference not set to an instance of an object." You need to resolve this exception.
What should you do?
A. To the application element of the Tester.exe.config file, add the following code segment:
<channels>
<channel ref="http">
<clientProviders>
<formatter ref="binary"/>
</clientProviders>
</channel>
</channels>
B.Replace the use of the AdminService constructor in Tester.exe with the following code segment:
Dim o as Object o = Activator.CreateInstance(GetType(AdminService))
service = Ctype(o, AdminService)
C.At the beginning of the Main method in Tester.exe, add the following line of code:
RemotingConfiguration.Configure("Tester.exe.config")
D. Rename the configuration file from Tester.exe.config to Tester.config.
Answer: C
30.You create a serviced component named Scheduler. Scheduler is registered in a library application. The Scheduler methods parse String objects into DateTime objects. You write a console application named Coverage.exe to test each method in Scheduler. You want Coverage.exe to test Scheduler for multiple cultures to verify its globalization support. What should you do?
A. Create a CultureInfo object for each culture locale before calling the Scheduler methods.
B. Create a RegionInfo object for each culture locale before calling the Scheduler methods.
C. Set the current thread's CurrentCulture property to each culture locale before calling the Scheduler methods.
D. Create a Coverage.exe.config file and add a element to the configuration file for each culture locale.
Answer: C


