Which of the following XML documents are well-formed?
A. <firstElement>some text goes here
<secondElement>another text goes here</secondElement>
</firstElement>
B. <firstElement>some text goes here</firstElement>
<secondElement> another text goes here</secondElement>
C. <firstElement>some text goes here
<secondElement> another text goes here</firstElement>
</secondElement>
D. </firstElement>some text goes here
</secondElement>another text goes here <firstElement>
ANSWER : A
Disadvantages of DTD are
(i) DTDs are not extensible
(ii) DTDs are not in to support for namespaces
(iii) there is no provision for inheritance from one DTDs to another
A. (i) is correct
B. (i),(ii) are correct
C. (ii),(iii) are correct
D. (i),(ii),(iii) are correct
ANSWER :D
To use the external DTD we have the syntax
A. <?xml version=”1.0” standalone=”no”?>
<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>
B. <?xml version=”1.0” standalone=”yes”?>
<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>
C. <?xml version=”1.0” standalone=”no”?>
<! DOCTYPE DOCUMENT “order.dtd”?>
D. <?xml version=”1.0” standalone=”yes”?>
<! DOCTYPE DOCUMENT SYSTEM “order.dtd”?>
ANSWER : A
A schema describes
(i) grammer
(ii) vocabulary
(iii) structure
(iv) datatype of XML document
A. (i) & (ii) are correct
B. (i),(iii) ,(iv) are correct
C. (i),(ii),(iv) are correct
D. (i),(ii),(iii),(iv) are correct
ANSWER : D
Attribute of the document interface in DOM is/are
(i)doctype
(ii)implementation
(iii)documentElement
which are read only attributes
A. (i) only
B. (ii) only
C. (ii),(iii) only
D. all
ANSWER : D
A textual object is a well formed XML document if
(i) Taken as a whole it matches the production labeled document.
(ii) Each of the parsed entity which is referenced directly or indirectly within the document can be well formed
A. (i) is correct
B. (ii)is correct
C. both are correct
D. None are correct
ANSWER : C
The transformation of XML document in to another type of document by XSLT can be done by
(i)In the server
(ii)In the client
(iii)With a separate program
A. only(i) & (ii)
B. only (ii) & (iii)
C. all are correct
D. only (i) & (iii)
ANSWER : C
You create the definition for a Vehicle class by using the following code segment. Public Class Vehicle <XmlAttribute(AttributeName:="category")> _ Public vehicleType As String Public model As String <XmlIgnore> _ Public year As Integer <XmlElement(ElementName:="mileage")> _ Public miles As Integer Public condition As ConditionType Public Sub New() End Sub Public Enum ConditionType <XmlEnum("Poor")> BelowAverage <XmlEnum("Good")> Average <XmlEnum("Excellent")> AboveAverage End Enum End Class You create an instance of the Vehicle class. You populate the public fields of the Vehicle class instance as shown in the following table: MemberValuevehicleTypecarmodelraceryear2002miles15000conditionAboveAverage You need to identify the XML block that is produced when this Vehicle class instance is serialized. Which block of XML represents the output of serializing the Vehicle instance?
A. <?xml version="1.0" encoding="utf-8"?> <Vehicle xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"" vehicleType="car"> <model>racer</model> <miles>15000</miles> <condition>AboveAverage</condition> </Vehicle>
B. <?xml version="1.0" encoding="utf-8"?> <Vehicle xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" category="car"> <model>racer</model> <mileage>15000</mileage> <condition>Excellent</condition> </Vehicle>
C. <?xml version="1.0" encoding="utf-8"?> <Vehicle xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" category="car"> <model>racer</model> <mileage>15000</mileage> <conditionType>Excellent</conditionType> </Vehicle>
D. <?xml version="1.0" encoding="utf-8"?> <Vehicle xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <category>car</category> <model>racer</model> <mileage>15000</mileage> <condition>Excellent</condition> </Vehicle>
Answer: B
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. EventLog eventLog = new EventLog(“testkobj”);
FileStream fileLog = File.Create(“testkobj.log”;
Trace.WriteLine(eventLog, “sample message”);
Trace.WriteLine(fileLog, “sample message”);
B. EventLog eventLog = new EventLog(“testkobj”);
FileStream fileLog = File.Create(“testkobj.log”);
Trace.Write(eventLog);
Trace.Write(fileLog);
Trace.WriteLine(“sample message”);
C. Trace.Listeners.Add(new
EventLogTraceListener(“testkobj”));
Trace.Listeners.Add(
new TextFileTraceListener(“testkobj.log”));
Trace.WriteLine(“sample message”);
D. Trace.Listeners.Add(new EventLogTraceListener());
Trace.Listeners.Add(
new.TextFileTraceListener(“testkobj.log”));
Trace.WriteLine(“sample message”);
ANSWER : C
You create a serviced component named SessionDispenser. This computer is in the Gsoft. Utilities assembly and is registered in a COM+ server application. SessionDispenser 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 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 Gsoft.Utilites.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 : C
You create an XML Web service named LatLong that converts street addresses to latitude and longitude coordinates. Gsoft Inc. 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. Event log = new EventLog(“LatLongLog”);
log.WriteEntry(refusalMessage, EventLogEntryType.Error);
B. EventLog log = new EventLog();
log.Source = “LatLongLog”;
log.WriteEntry(refusalMessage, EventLogEntryType.Error);
C. if (!EventLog.SourceExists(“LatLongSource”)) {
EventLog.CreateEventSource(“LatLongSource”,
“LatLongLog”);
}
EventLog.WriteEntry(“LatLongSource”,
refusalMessage, EventLogEntryType.Error);
D. if (!EventLog.SourceExists(“LatLongSource”)) {
EventLog.CreateEventSource(“LatLongSource”,
“LatLongLog”;
}
EventLog log = new EventLog(“LatLongLog”);
log.WriteEntry(refusalMessage, EventLogEntryType.Error);
ANSWER : C
You create a serviced component named GsoftOrderProcessor. OrderProcessor implements the IOrderinit interface. The component and the interface contain the following code segments:
[Guid(“0B6ABB29-43D6-40a6-B5F2-83A457D062AC”)]
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
public interface IOrderInit {
// IOrderInit methods go here.
}
public class OrderProcessor: ServicedComponent, IOrderInit {
// OrderProcessor methods go here.
}
You discover that every time you rebuild GsoftOrderProcessor, 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 GsoftOrderProcessor class.
B. Add a ComImport attribute to the IOrderInit interface.
C. To the GsoftOrderProcessor class, add the following attribute:
[ClassInterface(ClassInterfaceType.AutoDual)]
D. To the end of every method, add the following line of code:
Marshal.ReleaseComObject(this);
ANSWER : A
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 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 project’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 AutoFlash property of the Debug class to false.
ANSWER : C
You create an XML Web service named TimeTKService. Each time TimeTKService is started, it checks for the existence of an event log named TimeTKServiceLog. If TimeServiceLog does not exist, TimeTKService creates it. You discover that when TimeTKService creates TimeTKServiceLog, 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 TimeTKService, 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 of the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog registry key to give full control to the IUSR_computername user account.
ANSWER : A
You are creating an XML Web service named GsoftCustomer 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 two code segments should you use? (Each correct answer presents part of the solution. Choose two)
A. private static TraceSwitch mySwitch;
static BankCustomer {
mySwitch = new TraceSwitch(“tswitch”,“a trace switch”);}
B. public static TraceLevel level;
static BankCustomer {level = TraceLevel.Error;}
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(mySwitch != null,“An error occurred.”);
Trace.WriteLineIf(mySwitch != null,“Warning Message”);
F. Trace.WriteIf(level != TraceLevel.Off,“An error occurred.”);
Trace.WriteIf(level != TraceLevel.Off,“Warning message”);
ANSWER : A, C
You create a serviced component named TestKScheduler. TestKScheduler is registered in a library application. The Scheduler methods parse String objects into Date Time 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 TestKScheduler methods.
B. Create a RegionInfo object for each culture locale before calling the TestKScheduler methods.
C. Set the current thread’s CurrentCulture property to each culture locale before calling the TestKScheduler methods.
D. Create a Coverage.exe.config file and add a <location> element to the configuration file for each culture locale.
ANSWER : C
You have an ASP.NET application named TKWebApp. This application uses a private assembly named Employee to store and retrieve employee data. Employee is located in the bin directory of TKWebApp. You develop a new ASP.NET application named TKWebApp2 that also needs to use Employee. You assign Employee a strong name, set its version to 1.0.0.0, and install it in the global assembly cache. You then create a publisher policy assembly for version 1.0.0.0 and install it in the global assembly cache. You compile TKWebApp2 against version 1.0.0.0. You do not recompile MyWebApp. You then run TKWebApp. What is the most likely result?
A. A VersionNotFoundException is thrown.
B. Employee is loaded from the bin directory.
C. Version 1.0.0.0 of Employee is loaded from the global assembly cache.
D. Version 1.0.0.0 of Employee is loaded by the publisher policy assembly.
ANSWER : D
You are creating a Windows-based application named TKWinApp. To the application, you add a Windows Form named TKForm and a reference to a SingleCall .NET Remoting object named TheirObject. You need to ensure that TKForm creates an instance of TheirObject to make the necessary remote object calls. Which code segment should you use?
A. RemotingConfiguration.RegisterActivatedClientType(typeof(TheirObject),“http://GsoftServer/TheirAppPath/TheirObject.rem”);
TheirObject theirObject = new TheirObject();
B. RemotingConfiguration.RegisterWellKnownClientType(typeof(GsoftObject);“http://GsoftServer/TheirAppPath/TheirObject.rem”);
TheirObject theirObject = new TheirObject();
C. RemotingConfiguration.RegisterActivatedServiceType(typeof(TheirObject));
TheirObject theirObject = new TheirObject();
D. RemotingConfiguration.RegisterWellKnownServiceType(typeof(TheirObject),“http://GsoftServer/TheirAppPath/TheirObject.rem”,WellKnownObjectMode.Singleton);
TheirObject theirObject = new TheirObject();
ANSWER : B
You create an XML Web service project that consists of three services named BronzeService, SilverService, and GoldService. All three services are located in the same virtual directory on a production computer. When customers subscribe to your service, they select only one of the three available services. A new customer subscribes to SilverService. You need to create a discovery document that enables this customer to use only SilverService. Which discovery document should you create?
A. <disco:discovery
xmlns:disco=”http://schemas.xmlsoap.org/disco/”
xmlns:scl=http://schemas.xmlsoap.org/disco/scl/>
<scl:contractRef ref=”SilverService.asmx?wsdl” />
</disco:discovery>
B. <disco:discovery
xmlns:disco=”http://schemas.xmlsoap.org/disco/”
xmlns:scl=”http://schemas.xmlsoap.org/disco/scl/”>
<scl:contractRef ref=”SilverService.asmx” />
</disco:discovery>
C. <dynamicDiscovery xmlns=”urn:schemasdynamicdiscovery:
disco.2000-03-17”>
<exclude path=”_vti_cnf” />
<exclude path=”_vti_pvt” />
<exclude path=”_vti_log” />
<exclude path=”_vti_script” />
<exclude path=”_vti_txt” />
<exclude path=”Web References” />
</dynamicDiscovery>
D. <dynamicDiscovery xmlns=”urn:schemasdynamicdiscovery:
disco.2000-03-17”>
<exclude path=”_vti_cnf” />
<exclude path=”_vti_pvt” />
<exclude path=”_vti_log” />
<exclude path=”_vti_script” />
<exclude path=”_vti_txt” />
<exclude path=”Web References” />
<exclude path=”BronzeService.asmx” />
<exclude path=”GoldService.asmx” />
</dynamicDiscovery>
ANSWER : A
You create version 1.0.0.0 of an assembly named TestKiAssembly. You register the assembly in the global assembly cache. TestKiAssembly consists of two .NET Remoting objects named TKRemoteObject1 and TKRempoteObject2 These objects are configured in the App.config file of TestKiAssembly as shown in the following code segment:
<system.runtime.remoting>
<application>
<service>
<activated type=”TestKiAssembly.TKRemoteObject1,
TestKiAssembly, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=28dckd83491duj” />
<wellKnown mode=”SingleCall”
objectUri=”TKRemoteObject2.rem”
type=”TestKiAssembly.TKRemoteObject2, TestKiAssembly,
Version=1.0.0.0, Culture=neutral,
PublicKeyToken=28dckd83491duj” />
<channels>
<channel ref=”http” />
</channels>
</service>
</application>
</system.runtime.remoting>
You create an application named TKApp that resides on a different computer than TestKiAssembly. TKApp references version 1.0.0.0 of TestKiAssembly. TKApp contains code that activates instances of TKRemoteObject1 and TKRemoteObject2 to use their services. Due to changes in business needs, you must update TestKiAssembly. You create version 2.0.0.0 of TestKiAssembly, which is backward compatible, but you do not update any information in the App.config file of TestKiAssembly. You register version 2.0.0.0 of TestKiAssembly in the global assembly cache. You then rebuild TKApp. Which version of the remote object will MyApp activate?
A. Version 1.0.0.0 of TKRemoteObject1; version 1.0.0.0 of TKRemoteObject2.
B. Version 1.0.0.0 of TKRemoteObject1; version 2.0.0.0 of TKRemoteObject2.
C. Version 2.0.0.0 of TKRemoteObject1; version 1.0.0.0 of TKRemoteObject2.
D. Version 2.0.0.0 of TKRemoteObject1; version 2.0.0.0 of TKRemoteObject2.
ANSWER : B
You are creating an XML Web service named InventoryService for a Gsoft Ltd. Each branch of Gsoft Ltd. will build its own client application to consume InventoryService. Each branch connects to the main office of the dealership by using a virtual private network (VPN). All computers in the dealership run on Microsoft Windows operating systems. You need to ensure that callers of InventoryService are authenticated based on their Windows logon name and password. You configure Internet Information Services (IIS) according to your security needs. You need to configure the authentication type in the Web.config file. Which code segment should you use?
A. <authentication mode=”Basic” />
B. <authentication mode=”Forms” />
C. <authentication mode=”Integrated” />
D. <authentication mode=”Windows” />
ANSWER : D
You are preparing to deploy an XML Web service named GsoftInventoryService. This service queries a Microsoft SQL Server database and returns information to the caller. You use Visual Studio .NET to create a setup project. You need to install InventoryService. You also need to run a script to create the necessary SQL Server database and tables to store the data. To accomplish this, you need to configure the project to have administrator rights to the SQL Server database. You add a custom dialog box to the project that prompts the user for the administrator user name and password that are used to connect to the SQL Server database. You need to make the user name and password available to a custom Installer class that will execute the script. What should you do?
A. Add a launch condition that passed the user name and password to the Install subroutine.
B. Add a merge module to the project that captures the user name and password. Use the merge module to access these values in the Install subroutine.
C. Retrieve the user name and password from the savedState object in the Install subroutine.
D. Create a custom install action. Set the CustomActionData property to the entered user name and password. Then access these values in the Install subroutine.
ANSWER : D
You 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 (Regsvcs.exe).
D. Place a breakpoint in the Main method of the Windows service. Then run the application within the Visual Studio .NET integrated development environment (IDE).
ANSWER : A
You create a .NET Remoting object named Time. The Time is in the Utils namespace and is in an assembly file named Gsoft.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 TestK.exe to test the Time object. TestK.exe creates instances of the Time object by using the following method signature:
public Time CreateInstance() {
RemotingConfiguration.Configure(“TestK.exe.config”);
return new Time();
}
You want Gsoft.exe to create instances of the Time class on a compute named Hosting. What should you do?
A. Create a TestK.exe.config file that includes the following code segment:
<configuration> <system.runtime.remoting>
<application> <client>
<wellKnown
type=”Utils.Time, Gsoft”
url=”tcp://Hosting:80/UtilsSvr/Time.rem”/>
</client> </application>
</system.runtime.remoting> </configuration>
B. Create a TestK.exe.config file that includes the following code segment:
<configuration> <system.runtime.remoting>
<application> <client>
<wellKnown
type=”Utils.Time, Gsoft”
url=”http://Hosting/UtilsSvr/Time.rem”/>
</client> </application>
</system.runtime.remoting> </configuration>
C. Create a TestK.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, Gsoft”/>
<client> </application>
</system.runtime.remoting> </configuration>
D. Create a TestK.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, Gsoft”/>
</client> </application>
</system.runtime.remoting> </configuration>
ANSWER : B
You are creating an XML Web service that processes highly confidential messages. The service exposed a Web method named RetrieveMessage that takes as input a code name and returns an encrypted message. You create a SOAP extension and override the extension’s ProcessMessage method so that you can encrypt the message before it is sent back to the caller. You need to encrypt only the data within the RetrieveMessageResult node of the SOAP response. You create a function named EncryptMessage that encrypts the RetrieveMessageResult node. You need to ensure that this method gets called before sending the message back to the caller. During which SoapMessageStage should you call EncryptMessage?
A. BeforeSerialize
B. AfterSerialize
C. BeforeDeserialize
D. AfterDeserialize
ANSWER : B
You are developing an application named TestKApp by using Visual C# .NET and Visual Basic .NET. The application will use functions form a DLL written in unmanaged code. One function requires the calling application to allocate unmanaged memory, fill it with data, and pass the address of the memory to the function. On returning from the function, the calling application must deallocate the unmanaged memory. You need to decide how your application will handle unmanaged memory. What should you do?
A. Use a byte array.
B. Use the methods of the Marshal class.
C. Use the methods of the MemoryStream class.
D. Derive a new class from the Stream class, and override the allocation methods.
ANSWER : B
You are using Visual Studio .NET to develop an application to replace a COM-based application. You are assigned to write a .NET class that will be used by client applications as a COM object. Your class code is being moved and modified while development continues on the new application. You want to minimize any possible disruption to the COM interface as a result of code changes. Which code segment should you use?
A. [ClassInterface()]
public Class TKClassToExpose {
public int Calc() {
// Implementation code goes here.
}
}
B. [Guid(“9ED54F84-A89D-4fcd-A854-44251E925F09”)]
public interface ITKClassToExpose {
public int Calc();
}
[ClassInterface[ClassInterfaceType.None)]
public int Calc() {
// Implementation code goes here.
}
}
C. [Guid(“9ED54F84-A89D-4fcd-A854-44251E925F09”)]
[ComVisible(true)]
public class TKClassToExpose {
public int Calc() {
// Implementation code goes here.
}
}
D. [ClassInterface(ClassInterfaceType.AutoDispatch)]
public class TKClassToExpose {
public int Calc() {
// Implementation code goes here.
}
}
ANSWER : D
You are creating an ASP.NET application named TestKWebApp. To TestKWebApp, you add a Web reference to an XML Web service named UserService. UserService consists of a Web method named RetrieveUserInfo. This Web method takes a userID as input and returns a DataSet object containing user information. If the userID is not between the values 1 and 1000, a System ArgumentException is thrown. In TestKWebApp, you write a try/catch block to capture any exceptions that are thrown by UserService. You invoke RetrieveUserInfo and pass 1001 as the user ID. Which type of exception will be caught?
A. System.ApplicationException
B. System.ArgumentException
C. System.Web.Service.Protocols.SoapException
D. System.Web.Service.Protocols.SoapHeaderException
ANSWER : C
You are developing a Windows-based application that requires the use of a calculation function named CalculateValue. This function includes the following signature:
int CalculateValue(int x) ;
CalculateValue is located in an unmanaged DLL named GsoftFunctions.dll, and is not part of a COM interface. You need to be able to use CalculateValue in your application. Which action or actions should you take? (Choose all that apply)
A. Use Regsvr32.exe to register GsoftFunctions.dll.
B. Use Visual Studio .NET to add a reference to GsoftFunctions.dll.
C. To your application, add the following code segment:
using GsoftFunctions;
D. To your application, add the following code segment:
[DllImport(“GsoftFunctions.dll”)]
public static extern int CalculateValue(int x);
ANSWER : B, D
You are creating a .NET Remoting object named Dealer for automobile dealership. Dealer exposes a method named SaveGsoftSales that saves sales information for the dealership. Dealer is configured to use Integrated Windows authentication to authenticate its callers. You must ensure that all users of SaveGsoftSales are members of the Manager group before allowing the code within SaveGsoftSales to run. Which code segment should you use?
A. [PrincipalPermission(SecurityAction.Demand, Role=”Manager”)]
public DataSet SaveGsoftSales(DataSet sales) {
// Code to save sales data goes here.}
B. [PrincipalPermission(SecurityAction.LinkDemand, Role=Manager”)]
public DataSet SaveGsoftSales(DataSet sales) {
// Code to save sales data goes here.}
C. [PrincipalPermission(SecurityAction.InheritanceDemand, Role=”Manager”)]
public DataSet SaveGsoftSales(DataSet sales) {
// Code to save sales data goes here.}
D. public DataSet SaveGsoftSales(DataSet sales) {
string role = “Manager”;
PrincipalPermission perm = new PrincipalPermission(null, role);
// Code to save sales data goes here.}
ANSWER : A
You create three Windows services named TK1, TK2, and TK3. You want to install all three services on a computer named GsoftA by using the Installer tool (Installutil.exe). On the command line of GsoftA, you enter and run the following command: Installutil TK1 TK2 TK3 During the installation process, TK3 throws an installation error. The installation process completes. How many of the three services are now installed on GsoftA?
A. None
B. One
C. Two
D. Three
ANSWER : A
You create two serviced components named OrderPipeline and OrderAdmin. Each component is registered in a separate COM+ server application. Both components use pricing data. OrderPipeline reads the pricing data for placing user orders. OrderAdmin modifies the pricing data. You want to ensure that OrderPipeline accesses the pricing data as quickly as possible, while still being able to immediately retrieve any pricing changes made by OrderAdmin. What should you do?
A. Store the pricing data in the Shared Property Manager.
B. Store the pricing data in Microsoft SQL Server database.
C. Store the pricing data in a Hashtable object within OrderAdmin. Expose the Hashtable object through a property on OrderAdmin.
D. Store the pricing data in an XmlDocument object within OrderAdmin. Expose the XmlDocument object through a property on OrderAdmin.
ANSWER : C
You have a .NET Remoting object named Utils. The Utils class is a client-activated .NET Remoting object. You want to write a client application that creates and uses a Utils object. You want the client application to hold onto a reference to a Utils object for the duration of its execution. What should you do?
A. Construct the Utils object, and hold the object in a member variable.
B. Construct the Utils object, and set the LifeTimeService.LeaseTime to 0.
C. In the client application, create an Implementation of the ISponsor interface. Implement the Renewal method to extend the lease.
D. In the client application, create an Implementation of the ILease interface. Implement the CurrentLeaseTime property to return Int32.MaxValue.
ANSWER : C
You are creating a serviced component named UserManager. UserManager adds user accounts to multiple transactional data sources. The UserManager class includes the following code segment:
[Transaction(TransactionOption.Required)]
[SecurityRole(“Admin”)]
public class UserManager : ServicedComponent {
public void AddUser(string TestKname, string TestKpassword)
{
// Code to add the user to data sources goes here.
}
}
You must ensure that the AddUser method reliably saves the new user to either all data sources or no data sources. What should you do?
A. To AddUser, add the following attribute:
[AutoComplete()]
B. To UserManager, add the following attribute:
[JustInTimeActivation(false)]
C. To the end of AddUser, add the following line of code:
ContextUtil.EnableCommit();
D. To the end of AddUser, add the following line of code:
ContextUtil.MyTransactionVote = true;
ANSWER : C
You create a serviced component named Tracker that uses attributes to dynamically register itself for COM+ services. Tracker is in an assembly file named Gsoft.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 and 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 Gsoft.dll file. Instruct the administrator to copy Gsoft.dll to all production computers and to install it in the global assembly cache.
C. Provide to the administrator the Gsoft.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 Gsoft.dll to the merge module. Provide to the administrator the .msm file with installation instructions.
ANSWER : A
You are creating an XML Web service that provides a daily quotation from literary works to its customers. This quotation is requested in many different languages, thousands of times every day, and by thousands of Web sites operating many different platform. A Web method named GetGsoftQuotes takes a languageID as input. GetGsoftQuotes uses this language ID to retrieve a translated version of the daily quotation from a Microsoft SQL Server database and to return that quotation to the customer. You want to minimize the time it takes to return the translated version. What should you do?
A. Store each translated quotation by using the Cache object.
B. Store each translated quotation by using the Session object.
C. Set the BufferResponse property of the WebMethod attribute to false.
D. Set the CacheDuration property of the WebMethod attribute to an interval greater than zero.
ANSWER : A
You are creating a .NET Remoting object named PropertyCache. PropertyCache will hold a Hashtable object or name/value pairs. A variety of remote client applications will communicate with PropertyCache to set and get property values. You need to ensure that properties set by one client application are also accessible to other client applications. Which two actions should you take? (Each correct answer presents part of the solution. Choose two)
A. Configure PropertyCache to be a client-activated object.
B. Configure PropertyCache to be a server-activated Singleton object.
C. Configure PropertyCache to be a server-activated SingleCall object.
D. Derive the PropertyCache class from MarshalByRefObject and override InitializeLifetimeService() to return null.
E. Mark the PropertyCache class with the Serializable attribute. Implement the ISponsor interface in the PropertyCache class.
F. Implement the ISerializable and ILease interfaces in the PropertyCache class. Implement ILease.CurrentLeaseTime to return Int32.MaxValue.
ANSWER : B, E
You create a .NET Remoting object named Patientinfo that exposes medical patient information. Because of the confidential nature of the information, you must ensure that the data remains secure. You want client applications to connect to Patientinfo over a secure communication channel. You want to accomplish this task by writing the minimum amount of code. What should you do?
A. Create your own host application and use a TcpChannel and BinaryFormatter.
B. Create your own host application and use an HttpChannel and a SoapFormatter.
C. Install Patientinfo in an Internet Information Services (IIS) virtual directory. Configure Patientinfo to use a TcpChannel and a BinaryFormatter. Configure IIS to use SSL.
D. Install Patientinfo in an Internet Information Services (IIS) virtual directory. Configure Patientinfo to use an HttpChannel and a SoapFormatter. Configure IIS to use SSL.
ANSWER : D
You create an XML Web service named AutoPartsService that processes automobile part orders. This service exposes a Web method named PlaceTestKOrder, which is shown in the following code segment:
[WebMethod(TransactionOption.RequiresNew)]
public DataSet PlaceTestKOrder(DataSet orderData) {
Server1.BrakesService brakes = new
Server1.BrakesService();
Server2.PartsService parts = new Server2.PartsService();
// Call OrderBrakes to order only brakes.
brakes.OrderBrakes(orderData.Tables[“Brakes”]);
// Call OrderParts to order all other auto parts.
parts.OrderParts(orderData.Tables[“Parts”]);
}
BrakesService and PartsService are XML services. The TransactionOption property of OrderBrakes and OrderParts is set to TransactionOption.Required. You develop a Windows Forms application named TKPartOrderApp that consumes AutoPartsService. You run TKPartOrderApp and place and order for three sets of brakes and four wheels. While PlaceTestKOrder is placing the order for the wheels, you close TKPartOrderApp. What is the most likely result?
A. OrderParts stops processing the order, and all orders are cancelled.
B. OrderParts continues processing the order, and all orders are placed.
C. OrderParts stops processing the order, the brakes are ordered, but the wheels are not ordered.
D. OrderParts stops processing the order, the brakes are not ordered, but the wheels are ordered.
ANSWER : A
You create a serviced component named StockQuote that implements the IStockQuote interface. The StockQuote class includes the following code segment:
public class StockQuote : ServicedComponent, IStockQuote {
public Price GetQuote(Ticker stock) {
// Code for the method goes here.
}
}
You want to secure StockQuote so that it can only be accessed by users in the Customers and Managers roles. Which two actions should you take? (Each correct answer presents part of the solution. Choose to)
A. To the StockQuote class, add the following attribute:
[ComponentAccessControl]
B. To the StockQuote class, add the following attribute:
[Transaction(TransactionOption.Required)]
C. Implement the ISecurityCallContext COM interface in the StockQuote class.
Implement the IsCallerInRole method for the Customers and Managers roles.
D. To the StockQuote class, ad the following attributes:
[SecurityRole(“Customers”, false)]
[SecurityRole(“Managers”, false)]
E. To the beginning of the GetQuote method, add the following code segment:
if (!ContextUtil.IsCallerInRole(“Managers,Customers”)) {
throw new SecurityException(“Access is denied.”);
}
ANSWER : A, D
You are creating an XML Web service named myService. This service has a function named WriteMessage that writes messages to a flat file in the C:\TestKingLogs\myServiceLog directory. You want to implement security for WriteMessage so that WriteMessage and all the code it calls can write messages only to the myServiceLog directory. Which code segment should you use?
A. FileIOPermission filePermission = new FileIOPermission(FileIOPermissionAccess.Write,“C:\\TestKingLogs\myServiceLog”);
filePermission.Demand();
B. FileIOPermission filePermission = new FileIOPermission(FileIOPermissionAccess.Write,“C:\\TestKingLogs\myServiceLog”);
filePermission.Deny();
C. FileIOPermission filePermission = new FileIOPermission(FileIOPermissionAccess.Write,“C:\\TestKingLogs\myServiceLog”);
filePermission.PermitOnly();
D. FileIOPermission filePermission = new FileIOPermission(FileIOPermissionAccess.Write,“C:\\TestKingLogs\myServiceLog”);
filePermission.Assert();
ANSWER : C
You create an assembly that contains a collection of serviced components. You want to secure these components by using a collection of COM+ roles. Different groups of roles will secure different components. You need to ensure that role-based security is enforced in the assembly. You want to accomplish this goal by adding an attribute to the project source code. Which attribute should you use?
A. [assembly: SecurityRole(“Assembly”, true)]
B. [assembly:SecurityPermission(SecurityAction.RequestOptional)]
C. [assembly:ApplicationActivation(ActivationOption.Server)]
D. [assembly: ApplicationAccessControl(AccessChecksLevel =AccessChecksLevelOption.ApplicationComponent)]
ANSWER : C
You have a DataSet object named customersDataSet that contains a DataTable object named TestKCustomers. TestKCustomers retrieves information from a Microsoft SQL Server database. TestKCustomers contains a column named Region. You want to create a DataView object named customersDataView that contains only customers in which the value in the Region column is France. Which code segment should you use?
A. DataView customersDataView = new DataView(customersDataSet.Tables[“TestKCustomers”]);
customersDataView.FindRows(“Region = France”);
B. DataView customersDataView = new DataView(customersDataSet.Tables[“TestKCustomers”]);
customersDataView.FindRows(“Region = ‘France’”);
C. DataView customersDataView = new DataView(customersDataSet.Tables[“TestKCustomers”]);
customersDataView.RowFilter = (“Region = France”);
D. DataView customersDataView = new DataView(customersDataSet.Tables[“TestKCustomers”]);
customersDataView.RowFilter= (“Region = ‘France’”);
ANSWER : D
You are troubleshooting a Visual Studio .NET application that was developed by a former colleague. You find the following code segment within a large assembly:
XmlElement theElement;
XmlElement anotherElement;
XmlDocument doc = new XmlDocument();
XmlDeclaration theDecl =doc.AppendChild(theDecl);
theElement = doc.CreateElement(“Library”);
doc.AppendChild(theElement);
theElement = doc.CreateElement(“Book”);
theElement.SetAttribute(“type”,”Certification”);
anotherElement = doc.CreateElement(“TestKing 70-216 Q&A”);
anotherElement.InnerText = “Book Title”;
anotherElement.AppendChild(theElement);
doc.DocumentElement.AppendChild(theElement);
Which XML output is produced by this code segment?
A. <?xml version=”1.0”?>
<Library />
B. <?xml version=”1.0?>
<Library>
<Book type=” Certification” />
</Library>
C. <?xml version=”1.0”?>
<Library>
<Book type=” Certification”>
<Title> TestKing 70-216 Q&A </Title>
</Book>
</Library>
D. <?xml version=”1.0”?>
<Library>
<Title> TestKing 70-216 Q&A <Book type=”Certification”
/></Title>
<Library>
ANSWER : B
You have a DataSet object named loanCustomersDataSet that contains customers serviced by the loan department of TestKink Inc. You receive a second DataSet object named assetCustomersDataSet that contains customers serviced by the asset management department of your company. Both objects have the same structure. You want to merge assetCustomersDataSet into loanCustomersDataSet and preserve the original values in loanCustomersDataSet. Which code segment should you use?
A. loanCustomersDataSet.Merge(assetCustomersDataSet);
B. loanCustomersDataSet.Merge(assetCustomersDataSet, true);
C. assetCustomersDataSet.Merge(loanCustomersDataSet);
D. assetCustomersDataSet.Merge(loanCustomersDataSet, true);
ANSWER : B
You are developing an application that queries a table named Products in a Microsoft SQL Server database named TestKingData. The query will be stored in a string variable named sqlQuery. The query includes the following SQL code:
SELECT * FROM Products FOR XML AUTO
You must iterate the query results and populate an HTML table with product information.You must ensure that your application processes the results as quickly as possible.What should you do?
A. Use a SqlDataAdapter object and set its SelectCommand property to sqlQuery.
Use the Fill method of the SqlDataAdapter object to read the data into a DataSet object.
Loop through the associated rows to read the data.
B. Use a SqlDataAdapter object and set its SelectCommand property to sqlQuery.
Use the Fill method of the SqlDataAdapter object to read the data into a DataSet object.
Use the ReadXml method of the DataSet object to read the data.
C. Set the SqlCommand object’s CommandText to sqlQuery.
Use the ExecuteReader method of the SqlCommand object to create a SqlDataReader object.
Use the Read method of the SqlDataReader object to read the data.
D. Set the SqlCommand object’s CommandText to sqlQuery.
Use the ExecuteXmlReader method of the SqlCommand object to create an XmlReader object.
Use the XmlReader object to read the data.
ANSWER : D
You are developing an application that retrieves a list of geographical regions from a table in a Microsoft SQL Server database. The list of regions is displayed in a dropdown list box on a Windows Form. You want to populate the list box with data from a DataSet object. You want to fill the DataSet object by using a SqlDataAdapter object. You create a SqlConnection object named TKConnection and a SQL query string named regionSQL. You need to write the code to create the SqlDataAdapter object. Which code segment should you use?
A. SqlDataAdapter TKDataAdapter = new SqlDataAdapter();
TKDataAdapter.SelectCommand.Connection = TKConnection;
TKDataAdapter.SelectCommand.CommandText = regionSQL;
B. SqlDataAdapter TKDataAdapter = new
SqlDataAdapter(regionSQL, TKConnection);
C. SqlCommand SqlCmd = new SqlCommand(regionSQL);
SqlDataAdapter TKDataAdapter = new SqlDataAdapter();
TKDataAdapter.SelectCommand.Connection= TKConnection;
TKDataAdapter.SelectCommand = SqlCmd;
D. SqlCommand SqlCmd = new SqlCommand();
SqlDataAdapter TKDataAdapter = new SqlDataAdapter();
SqlCmd.CommandText = regionSQL;
TKDataAdapter.SelectCommand.Connection= TKConnection;
ANSWER : B
Your Microsoft SQL Server 6.5 database contains a table named TestKPurchaseOrders that consists of more than 1 million rows. You are developing an application to populate a DataReader object with data from TestKPurchaseOrders. You want to ensure that the application processes the data as quickly as possible. You create a SQL SELECT statement in a local variable named TKSQLSelect. You need to instantiate a SqlConnection object and a SqlCommand object that you will use to populate the DataReader object. Which code segment should you use?
A. OleDbConnection myConnection = new OleDbConnection(myOleDbConnectionString);
OleDbCommand TKCommand = new OleDbCommand(TKSQLSelect);
B. OleDbConnection TKConnection = new OleDbConnection(TKOleDbConnectionString);
OleDbCommand TKCommand = new OleDbCommand(TKSQLSelect, TKConnection);
C. SqlConnection TKConnection = new SqlConnection(TKSqlConnectionString);
SqlCommand TKCommand = new SqlCommand(TKSQLSelect);
D. SqlConnection TKConnection = new SqlConnection(TKSqlConnectionString);
SqlCommand TKCommand = new SqlCommand(TKSQLSelect, TKConnection);
ANSWER : B
You have a DataSet object that contains a single DataTable object named TestKEmployees. TestKEmployees 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 TestKEmployees.
B. Ensure that EmployeeID is unique for each row in TestKEmployees.
C. Ensure that TestKEmployees has a primary key on EmployeeID.
D. Ensure that TestKEmployees is sorted in ascending order on EmployeeID.
ANSWER : C
You have a SqlDataReader object named TKproductsDataReader. The productsDataReader object contains three columns in the following order:
• ProductID as Integer
• ProductName as nvarchar(40)
• UnitsInStock as Integer
You want to use TKproductsDataReader to create an inventory management report.You define the following three variables:
• int myProductID;
• string myProductName;
• int myUnits;
You need to ensure that the report runs as quickly as possible.Which code segment should you use?
A. myProductID = (int) TKproductsDataReader[1];
myProductName = (string) TKproductsDataReader[2];
myUnits = (int) TKproductsDataReader[3];
B. myProductID = (int) TKproductsDataReader[0];
myProductName = (string) TKproductsDataReader[1];
myUnits = (int) TKproductsDataReader[2];
C. myProductID = (int) TKproductsDataReader[“ProductID”];
myProductName = (string)
TKproductsDataReader[“ProductName”];
myUnits = (int) TKproductsDataReader[“UnitsInStock”];
D. myProductID = (int)
TKproductsDataReader.GetOrdinal(“ProductID”);
myProductName = (string)
TKproductsDataReader.GetOrdinal(“ProductName”);
myUnits = (int)
TKproductsDataReader.GetOrdinal(“UnitsInStock”);
ANSWER : B
TestKing Ltd. receives product information from manufactures in the form of an XML documents. The product information is stored in a Microsoft SQL Server database. The format of each XML document varies. Each one is located in a MemoryStream object named newProds. You create a merge procedure that reads data and schema information in a DataSet object and merges the information into your database. You now need to write code to transfer the XML document and its schema into a DataSet object. Which code segment should you use?
A. DataSet products = new DataSet(“prodInfo”);
XmlTextReader reader = new XmlTextReader(newProds);
XmlValidatingReader validReader = new
XmlValidatingReader(reader);
while (validReader.Read()) {
products.WriteXml(validReader.Value);
}
B. DataSet products = new DataSet(“prodInfo”);
products.ReadXml(newProds);
C. DataSet products = new DataSet(“prodInfo”);
XmlDataDocument document =
new XmlDataDocument(products);
document.DataSet.ReadXmlSchema(newProds);
D. DataSet products = new DataSet(“prodInfo”);
string myXmlData =
Encoding.UTF8.GetString(newProds.ToArrary());
SqlDataAdapter adapter =
new SqlDataAdapter(“LoadSchemaType=XML”,myXmlData);
adapter.Fill(products)
ANSWER : B
Your Microsoft SQL Server database has a stored procedure named GetCompanyName. Ge accepts one parameter named @CustomerID and returns the appropriate company name. You instantiate a SqlCommand object named TKCommand. You need to initialize TKCommand to return the company name for @CustomerID with a value of “ALFKI”. Which code segment should you use?
A. TKCommand.CommandText = “GetCompanyName, ALFKI”;
TKCommand.Parameters.Add(“@CustomerID”);
B. TKCommand.CommandText = “GetCompanyName”;
TKCommand.Parameters.Add(“GetCompanyName”, “ALFKI”);
C. TKCommand.CommandText = “@CustomerID”;
TKCommand.Parameters.Add(“GetCompanyName”, “ALFKI”);
D. TKCommand.CommandText = “GetCompanyName”;
TKCommand.Parameters.Add(“@CustomerID”, “ALFKI”);
ANSWER : D
You are developing an application to monitor store inventory. When inventory falls below a specified level, the application automatically generates a purchase request. Suppliers have requested that you transmit purchase requests to them in an XML document. Suppliers will accept the XML document in any valid form, except they do not want the data set definition to be included in the XML file. You create a method named GeneratePurchaseRequest. You write the code to populate a DataSet object named myDataSet with the purchase request data. You define a variable named fileName that contains the name and path of the output file. You need to create an XML file from the data in myDataSet by adding code to GeneratePurchaseRequest. You want to accomplish this task by writing the minimum amount of code. Which code segment should you use?
A. myDataSet.WriteXML(fileName, XmlWriteMode.IgnoreSchema);
B. myDataSet.WriteXML(fileName, XmlWriteMode.WriteSchema);
C. myDataSet.WriteXMLSchema(filename);
D. TextWriter myWriter = new StreamWriter(fileName);
myDataSet.WriteXMLSchema(myWriter);
ANSWER : A
You have a DataSet object named TKDataSet that is populated with data from a Microsoft SQL Server database. This object contains insertions, deletions, and updates to the data. You want to apply the data changes in TKDataSet to the database. You decide to use the SqlClient data provider. You need to create a data object that you will use to update the database. Which code segment should you use?
A. SqlDataReader myDataReader;
B. SqlDataAdapter mySqlDataAdapter = new sqlDataAdapter();
C. DataObject myDataObject = new DataObject();
D. SqlParameter myParameter = new SqlParameter();
ANSWER : B
You are planning to create a DataSet object named TKDataSet to be used in a bondtrading application. Several developers will need to write code to manipulate myDataSet, and you want to ensure that TKDataSet is easy for them to use. You decide to create TKDataSet as a strongly typed data set. Which two actions should you take? (Each correct answer presents part of the solution. Choose two)
A. Create an XSD schema that defines TKDataSet.
B. Create an XDR schema that defines TKDataSet.
C. Create a class for TKDataSet that is based on the schema and that inherits from the DataSet class.
D. Create a class for TKDataSet that is based on the schema and that inherits from the XmlSchema class.
E. Create a key pair for TKDataSet by using the Strong Name tool (Sn.exe).
ANSWER : A, C
You develop an ADO.NET application that uses a Microsoft SQL Server database and a SqlClient data provider. Your application includes the following four code segments, which are each called once:
SqlConnection myConnection1 = new SqlConnection();
myConnection1.ConnectionString = “Data Source=TestKServer;”
+ “Initial Catalog=Billing;Integrated Security=true”;
myConnection1.Open();
SqlConnection myConnection2 = new SqlConnection();
myConnection2.ConnectionString = “Data Source=TestKServer;”
+ “Initial Catalog=Billing;Integrated Security=True”;
myConnection2.Open();
SqlConnection myConnection3 = new SqlConnection();
myConnection3.ConnectionString=
“Data Source=TestKingServerB;”
+ “Initial Catalog=Search;Integrated Security=true”;
myConnection3.Open();
SqlConnection myConnection4 = new SqlConnection();
myConnection4.ConnectionString = “Data Source=TestKServer;”
+ “Initial Catalog=OrderEntry;Integrated Security=true”;
myConnection4.Open();
You verify that your application is the only application that is using SQL Server. Your application runs all code segments by using the same identity. You run the application. Connection pooling is enabled, and the entire application runs within the connection timeout parameter. How many connection pools are created?
A. One
B. Two
C. Three
D. Four
ANSWER : C
You have a SqlDataReader object named ordersDataReader. This object contains a column named OrderQuantity that has an integer value. This object also contains one row for each order received during the previous week. You need to write code that will process each row in ordersDataReader and pass OrderQuantity to a function named myFunction. Which code segment should you use?
A. long weeklyOrderQuantity = 0;
while (ordersDataReader.Read()) {
myFunction((int)ordersDataReader[“OrderQuantity”]);
}
B. long weeklyOrderQuantity = 0;
while (ordersDataReader.NextResult()) {
myFunction((int)ordersDataReader[“OrderQuantity”]);
}
C. long weeklyOrderQuantity = 0;
int orderCount = 0;
while (orderCount < ordersDataReader.FieldCount) {
myFunction((int)ordersDataReader[“OrderQuantity”]);
orderCount++;
ordersDataReader.Read();
}
D. long weeklyOrderQuantity = 0;
int orderCount = 0;
while (orderCount < ordersDataReader.FieldCount) {
myFunction((int)ordersDataReader[“OrderQuantity”]);
orderCount++;
ordersDataReader.NextResult();
}
ANSWER : A