|
Question |
Rating |
View Answer |
|
You create an XML Web service named LatLong that converts street addresses to latitude and longitude coordinates. Company 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 LatLong Log. You anticipate that there will be a lot of these log entries over time. A string object named refusal Message contains the message to log. Which code segment should you use? A. Event log = new EventLog("LatLong Log"); log.WriteEntry(refusal Message, EventLogEntryType.Error); B. EventLog log = new EventLog(); log.Source = "LatLong Log"; log.WriteEntry(refusal Message, EventLogEntryType.Error); C. if (!EventLog.SourceExists("LatLongSource")) { EventLog.CreateEventSource("LatLongSource","LatLongLog");} EventLog.WriteEntry("LatLongSource", refusal Message, EventLogEntryType.Error); D. if (!EventLog.SourceExists("LatLongSource")) {EventLog.CreateEventSource("LatLongSource","LatLongLog"; }EventLog log = new EventLog("LatLong Log"); log.WriteEntry(refusal Message, EventLogEntryType.Error);
|
|
View Answer |
|
You are creating an XML Web service that processes highly confidential messages. The service exposed a Web method named Retrieve Message that takes as input a code name and returns an encrypted message. You create a SOAP extension and override the extension's Process Message 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 Encrypt Message 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 Encrypt Message? A. Before Serialize B. After Serialize C. Before Deserialize D. After Deserialize
|
|
View Answer |
|
You create an XML Web service named AutoPartsService that processes automobile part orders. This service exposes a Web method named PlaceExamSOrder, which is shown in the following code segment: [WebMethod(TransactionOption.RequiresNew)] public DataSet PlaceExamSOrder(DataSetorderData) { 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 ESPartOrderApp that consumes AutoPartsService. You run ESPartOrderApp and place and order for three sets of brakes and four wheels. While PlaceExamSOrder is placing the order for the wheels, you close ESPartOrderApp. 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.
|
|
View Answer |
|
Company 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); D. document.DataSet.ReadXmlSchema(newProds); Dataset products = new Dataset("prodInfo"); string myXmlData = Encoding.UTF8.GetString(newProds.ToArrary()); SqlDataAdapter adapter = new SqlDataAdapter("LoadSchemaType=XML",myXmlData); adapter. Fill(products)
|
|
View Answer |
|
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 GetCompanyQuotes takes a languageID as input. GetCompanyQuotes 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 Buffer Response property of the WebMethod attribute to false. D. Set the Cache Duration property of the WebMethod attribute to an interval greater than zero. |
|
View Answer |
|
You have a SqlDataReader object named ESproductsDataReader. The products DataReader object contains three columns in the following order: • ProductID as Integer • ProductName as nvarchar(40) • UnitsInStock as Integer You want to use ESproductsDataReader 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) ESproductsDataReader[1]; myProductName = (string) ESproductsDataReader[2]; B. myUnits = (int) ESproductsDataReader[3]; myProductID = (int) ESproductsDataReader[0]; myProductName = (string) ESproductsDataReader[1]; myUnits = (int) ESproductsDataReader[2]; C. myProductID = (int) ESproductsDataReader["ProductID"]; myProductName = (string) ESproductsDataReader["ProductName"]; myUnits = (int) ESproductsDataReader["UnitsInStock"]; D. myProductID = (int) ESproductsDataReader.GetOrdinal("ProductID"); myProductName = (string) ESproductsDataReader.GetOrdinal("ProductName"); myUnits = (int)ESproductsDataReader.GetOrdinal("UnitsInStock");
|
|
View Answer |
|
You are creating an ASP.NET application named CompanyWebApp. To CompanyWebApp, you add a Web reference to an XML Web service named User Service. User Service 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 Argument Exception is thrown. In CompanyWebApp, you write a try/catch block to capture any exceptions that are thrown by User Service. 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
|
|
View Answer |
|
You create a serviced component named Tracker that uses attributes to dynamically register itself for COM+ services. Tracker is in an assembly file named Company.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 Company.dll file. Instruct the administrator to copy Company.dll to all production computers and to install it in the global assembly cache. C. Provide to the administrator the Company.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 Company.dll to the merge module. Provide to the administrator the .msm file with installation instructions.
|
|
View Answer |
|
You have a .NET Remoting object named ES ProductLoader. The ES ProductLoader class is a server-activated Singleton object. The ES ProductLoader class loads product data into a Microsoft SQL Server database. The Load method of the ES ProductLoader class is a time-consuming method to call. You are developing a client application that uses the ES ProductLoader class. You want to ensure that the client application can continue to respond to user input while the Load method of the ES ProductLoader class is called. What should you do? A. Use an AsyncDelegate instance to call the Load method. B. Modify the ES ProductLoader class to be derived from IAsyncResult. C. Configure the ES ProductLoader 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 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 datas. B. Store each Dataset object by using the Session object. C. Set the Buffer Response property of the Web Method attribute to false. D. Set the Cache Duration property of the Web Method attribute to an interval greater than zero.
|
|
View Answer |
|
You are developing an application named ExamSApp 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.
|
|
View Answer |
|
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. [Class Interface()] public Class ESClassToExpose { public int Calc() { // Implementation code goes here.}} B. [Guid("9ED54F84-A89D-4fcd-A854-44251E925F09")] public interface IESClassToExpose { public int Calc(); } [Class Interface[ClassInterfaceType.None)] public int Calc() {// Implementation code goes here. } } C. [Guid("9ED54F84-A89D-4fcd-A854-44251E925F09")] [COM Visible(true)] public class ESClassToExpose { public int Calc() { // Implementation code goes here.}} D. [Class Interface(ClassInterfaceType.AutoDispatch)] public class ESClassToExpose { public int Calc() { // Implementation code goes here.}}
|
|
View Answer |
|
You develop an ASP.NET application that consumes a third-party XML Web service named Credit Service. Credit Service contains a Web method named Charge Card. Charge Card takes as input a credit card number, a billing address, and a monetary amount and returns a Boolean variable that indicates whether or not the card was charged. Calls to Charge Card take one minute to complete. You do not want users to have to wait while Charge Card executes. You want users to be taken automatically to the next Web page of the application. Which code segment should you use to call Credit Service? A. CreditService.ChargeCard(ccNumb, billAddress,Amount); Server.Transfer("process.aspx"); B. CreditService.ChargeCard(ccNumb, billAddress, amount); Response.Redirect("process.aspx"); C. CreditService.BeginChargeCard(ccNumb, billAddress, amount, new AsyncCallback(CCResponse), null); Server.Transfer("process.aspx");private void CCResponse(IAsyncResult aRes) { CreditService.EndChargeCard(aRes);} D. IAsyncResult AsyncResult = CreditService.BeginChargeCard(ccNumb, billAddress, amount, null, null); AsyncResult.AsyncWaitHandle.WaitOne(); CreditService.EndChargeCard(AsyncResult); Server.Transfer("process.aspx");
|
|
View Answer |
|
You create an XML Web service named Time ESService. Each time ESService is started, it checks for the existence of an event log named Time ESServiceLog. If TimeServiceLog does not exist, Time ESService creates it. You discover that when Time ESService creates Time ESServiceLog, 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 Time ESService, 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 KEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesEventlog registry key to give full control to the IUSR_computername user account.
|
|
View Answer |
|
You create an XML Web service named Postal Code. Your project source includes a codebehind 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 Postal Code 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 Postal Code class to set the Auto Flash property of the Debug class to false. E. Add code to the constructor of the Postal Code class to call the Clear method of the Debug.Listeners property.
|
|
View Answer |
|
You are creating an XML Web service named Inventory Service for a Company Ltd. Each branch of Company 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" />
|
|
View Answer |
|
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 ("ExamSobj"); File Stream file Log = File. Create("ExamSobj.log"; Trace.Write Line (eventLog, "sample message"); Trace.Write Line(fileLog, "sample message"); B. EventLog eventLog = new EventLog("ExamSobj"); FileStream fileLog = File.Create("ExamSobj.log"); Trace.Write(eventLog); Trace.Write(fileLog); Trace.WriteLine("sample message"); C. Trace.Listeners.Add(new EventLogTraceListener("ExamSobj")); Trace.Listeners.Add( new TextFileTraceListener("ExamSobj.log")); Trace.WriteLine("sample message"); D. Trace.Listeners.Add(new EventLogTraceListener()); Trace.Listeners.Add( new.TextFileTraceListener("ExamSobj.log")); Trace.WriteLine("sample message");
|
|
View Answer |
|
You are developing an application that queries a table named Products in a Microsoft SQL Server database named CompanyData. 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 DataSetobject. 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.
|
|
View Answer |
|
You are planning to create a Dataset object named ES DataSet to be used in a bond-trading application. Several developers will need to write code to manipulate myDataSet, and you want to ensure that ES DataSet is easy for them to use. You decide to create ES DataSet 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 ES DataSet. B. Create an XDR schema that defines ES DataSet. C. Create a class for ES DataSet that is based on the schema and that inherits from the Dataset class. D. Create a class for ES DataSet that is based on the schema and that inherits from the XmlSchema class. E. Create a key pair for ES DataSet by using the Strong Name tool (Sn.exe).
|
|
View Answer |
|
You have a Dataset object named ES DataSet 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 ES DataSet to the database. You decide to use the Sulligent 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();
|
|
View Answer |