|
Related Questions |
View Answer |
|
You develop an application named EXApp. This application needs to run on the same computer as a Windows service named EXService. You want to ensure that EXService starts from EXApp if EXService is not already running.. Which code segment should you use? A. Dim myServiceController As New _ ServiceController(“EXService”) If myServiceController.Status = _ ServiceControllerStatus.Stopped Then myServiceController.Start() End If B. Dim myServiceController As New _ ServiceController(“EXService”)myServiceController.Start() C. Dim myServiceController As New _ ServiceController() Dim myArgs(1)As String my Args(0)=”EXService” If myServiceController.Status = ServiceControllerStatus.Stopped Then myServiceController.Start(myArgs) End If D. Dim myServiceController As New _ ServiceController() Dim myArgs(1) As String my Args(0)= “EXService” myServiceController.Start(myArgs)
|
View Answer
|
|
You are creating an XML Web service named XYZService. This service has a function named WriteMessage that writes messages to a flat file in the C:EXServiceLog directory.. You want to implement security for WriteMessage so that WriteMessage and all the code it calls can write messages only to the EXServiceLog directory. Which code segment should you use? A. Dim filePermission As New FileIOPermission_(FileIOPermissionAccess.Write, “C:EXServiceLog”) filePermission.Demand() B. Dim filePermission As New FileIOPermission_(FileIOPermissionAccess.Write, “C:EXServiceLog”) filePermission.Deny() C. Dim filePermission As New FileIOPermission_(FileIOPermissionAccess.Write, “C:EXServiceLog”) filePermission.PermitOnly() D. Dim filePermission As New FileIOPermission_(FileIOPermissionAccess.Write, “C:EXServiceLog”) filePermission.Assert()
|
View Answer
|
|
You are developing an ASP.NET application that consumes an XML Web service named AccountInformation. AccountInformation exposes a Web method named GetAccountBalance that expects encrypted user credentials to be passed in the SOAP header. AccountInformation also exposes a public class named AuthenticateUser. AuthenticateUser has two properties named Username and Password that are both defined as string.. In the application, you create two local variable named encryptedUsername and encryptedPassword that you will use to pass user credentials to GetAccountBalance. You need to write code that will execute the GetAccountBalance Web method. Which code segment should you use? A. Dim EXAccountInformation As New AccountInformation() Dim EXAuthenticateUser As New AuthenticateUser() EXAuthenticateUser.Username = encryptedUsername EXAuthenticateUser.Password = encryptedPassword EXAccountInformation.AuthenticateUserValue = _myAuthenticateUser Dim accountBalance As String accountBalance = myAccountInformation. GetAccountBalance() B. Dim EXAccountInformation As New AccountInformation() Dim EXAuthenticateUser As New AuthenticateUser() EXAuthenticateUser.Username = encryptedUsername EXAuthenticateUser.Password = encryptedPassword Dim accountBalance As String accountBalance = EXAccountInformation.GetAccountBalance() C. Dim EXAccountInformation As New AccountInformation() Dim EXAuthenticateUser As New AuthenticateUser() Dim Username As New SoapHeaderAttribute(“Username”) Username.MemberName = encryptedUserPassword Dim accountBalance As String accountBalance = EXAccountInformation.GetAccountBalance() D. Dim EXAccountInformation As New AccountInformation() Dim EXAuthenticateUser As New AuthenticateUser() EXAuthenticateUser.Username = encryptedUsername EXAuthenticateUser.Password = encryptedPassword Dim EXSoapHeaderCollection As New SoapHeaderCollection() EXSoapHeaderCollection.Add(myAuthenticateUser) Dim accountBalance As String accountBalance = EXAccountInformation.GetAccountBalance()
|
View Answer
|
|
You are creating a .NET Remoting object named BankOps. BankOps exposes methods for creating, finding, and modifying objects in a class named BankCustomer. BankCustomer has a large number of read/write properties.. You expect a large number of remote client applications to frequently connect to BankOps. You expect these remote client applications to use many of the BankCustomer properties. You want to ensure that network traffic is minimized. What should you do? A. Add the Serializable attribute to the BankCustomer class. B. Implement the IDisposable interface in the BankCustomer class. C. Derive the BankCustomer class from ContextBoundObject. D. Derive the BankCustomer class from MarshalByRefObject. Override the inherited InitializeLifetimeService method to return null.
|
View Answer
|
|
You have a .NET Remoting object named ProductLoaderEX. The ProductLoaderEX class is a server-activated Singleton object. The ProductLoaderEX class loads product data into a Microsoft SQL Server database. The Load method of the ProductLoaderEX class is a time-consuming method to call. You are developing a client application that uses the ProductLoaderEX class. You want to ensure that the client application can continue to respond to user input while the Load method of the ProductLoaderEX class is called. What should you do? A. Use an AsyncDelegate instance to call the Load method. B. Modify the ProductLoaderEX class to be derived from IAsyncResult. C. Configure the ProductLoaderEX class to be a client-activated .NET Remoting object. D. Configure the client application to have its own remoting channel that matches the server’s channel and formatter.
|
View Answer
|
|
You are creating an XML Web service that will be accessed by callers who cannot use SSL encryption because if firewall restrictions. To protect sensitive data, you want to encrypt a portion of the data returned from the service by using objects in the Cryptography namespace. The service will use a standard encryption routine to encrypt the data before it is sent to the caller. The caller will decrypt the data by using instructions provided by you. You need to write code to encrypt the sensitive data that is in a local variable named XYZData. First, you create an instance of a Cryptography Service Provider. What should you do next? A. Create an Encryptor object that passes in a key and an initialization vector (IV) as parameters. Call the GetHashCode method of the Encryptor object to generate a new hash code. Convert the generated hash code to a stream and use the CryptoStream object to write the value of the hash code to an encrypted stream. Convert the output stream to a string. B. Create a UnicodeEncoding object and use it to encode the value of XYZData into a byte array. Use the ComputeHash method of the Cryptography Service Provider to create a hash from the encoded byte array. Convert the output of ComputeHash from a byte array to a string. C. Create a UnicodeEncoding object and use it to encode the value of XYZData into a byte array. Use the GetHashCode method of the Cryptography Service Provider to create a hash from the encoded byte array. Convert the output of GetHashCode from a byte array to a string. D. Create an Encryptor object that passes in a key and an initialization vector (IV) as parameters. Create a CryptoStream object that passes in an output stream and the Encryptor object as parameters. Convert XYZData to a stream and use the CryptoStream object to write the value of XYZData to an encrypted stream. Convert the output stream to a string.
|
View Answer
|
|
ou are creating an XML Web service named ListBoxService. This service provides content, such as states, countries, and geographical regions, for use in drop-down list boxes. ListBoxService contains a Web method named RetrieveRegionsListBox. This method runs a DataSet object that contains every geographical region in the world. RetrieveRegionsListBox calls a Microsoft SQL Server database to load the DataSet object with region data. You want to minimize the amount of time the method takes to return to the caller. What should you do? A. Use a stored procedure to return the data. B. Store each DataSet object 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.
|
View Answer
|
|
You are creating a .NET Remoting object named XYZPayroll. The XYZPayroll class allows remote client applications to access payroll data for your company. Client applications are developed by using Windows Forms and Web Forms. You must ensure that remote client applications are securely authenticated prior to gaining access to Payroll object. You want to accomplish this task by writing the minimum amount of code. What should you do? A. Use a TcpChannel and a BinaryFormatter for the XYZPayroll class. B. Use an HttpChannel and a SoapFormatter for the XYZPayroll class. C. Host the XYZPayroll class in Internet Information Services (IIS) and implement Basic authentication. D. Host the XYZPayroll class in Internet Information Services (IIS) and implement Integrated Windows authentication.
|
View Answer
|
|
XYZ Inc. provides a credit card processing application for its customers. The current application supports only computers that run on a Microsoft Windows operating system. You are asked to rewrite the current application as a .NET application. This .NET application does not need to be backward compatible with the current application. You must ensure that this new application meets the following requirements: • Must support asynchronous processing. • Must be able to pass data through firewalls. • Must pass only SOAP-Compliant formatted data validated by using an XSD schema. • Must not be limited to client computers running on a Microsoft operating system. You want to accomplish this task by using the minimum amount of development effort. Which type of .NET application should you use? A. Windows service B. XML Web service C. Serviced component D. .NET Remoting object
|
View Answer
|
|
You are planning to create a DataSet object named EXDataSet to be used in a bond-trading application. Several developers will need to write code to manipulate EXDataSet, and you want to ensure that myDataSet is easy for them to use. You decide to create EXDataSet 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 EXDataSet. B. Create an XDR schema that defines EXDataSet. C. Create a class for EXDataSet that is based on the schema and that inherits from the DataSet class. D. Create a class for EXDataSet that is based on the schema and that inherits from the XmlSchema class. E. Create a key pair for EXDataSet by using the Strong Name tool (Sn.exe).
|
View Answer
|
|
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).
|
View Answer
|
|
You have a DataSet object that contains a single DataTable object named XYZEmployees. XYZEmployees 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 XYZEmployees 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 XYZEmployees. B. Ensure that EmployeeID is unique for each row in XYZEmployees. C. Ensure that XYZEmployees has a primary key on EmployeeID. D. Ensure that XYZEmployees is sorted in ascending order on EmployeeID.
|
View Answer
|
|
You are creating an XML Web service named InventoryService for a national automobile dealership. Each branch of the dealership 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” />
|
View Answer
|
|
You create a .NET Remoting object named EXPatientinfo 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 EXPatientinfo 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 EXPatientinfo in an Internet Information Services (IIS) virtual directory. Configure EXPatientinfo to use a TcpChannel and a BinaryFormatter. Configure IIS to use SSL. D. Install EXPatientinfo in an Internet Information Services (IIS) virtual directory. Configure EXPatientinfo to use an HttpChannel and a SoapFormatter. Configure IIS to use SSL.
|
View Answer
|
|
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.
|
View Answer
|