PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

What should you do?

You are developing a Windows Communication Foundation (WCF) service that allows customers to update financial data.
The client applications call the service in a transaction. The service contract is defined as follows.
(Line numbers are included for reference only.)

01 [ServiceContract]
02 public interface IDataUpdate
03 {
04 [OperationContract]
05 [TransactionFlow(TransactionFlowOption.Mandatory)]
06 void Update(string accountNumber, double amount);
07 }
08
09 …
10 class UpdateService : IDataUpdate
11 {
12 [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)]
13 public void Update(string accountNumber, double amount)
14 {
15 try
16 {
17 …
18 }
19 catch(Exception ex)
20 {
21 WriteErrorLog(ex);
22 …
23 }
24 }
25 }
26

Customers report that the transaction completes successfully even if the Update method throws an exception.
You need to ensure that the transaction is aborted if the Update method is not successful. What should you do?

Which HTTP request should you use?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Windows Communication
Foundation (WCF) Data Services service. You deploy the data service to the following URL: http://contoso.com/Northwind.svc.
You need to update the City property of the Customer record that has its ID value as 123.
You also need to preserve the current values of the remaining properties. Which HTTP request should you use?

What should you recommend?

You are evaluating an ASP.NET Web application that includes three methods:
-Calculate() performs CPU-intensive calculations on the server.
-GetData() retrieves data from a server-side data store and returns an XML file.
-WriteData() receives an XML file and writes data from the file to a server-side data store.
You need to recommend an approach for maximizing server throughput.
What should you recommend?

Which URL should you use for the query?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create a Windows Communication
Foundation (WCF) Data Services service. You deploy the service to the following URL: http://contoso.com/Northwind.svc.
You want to query the WCF Data Services service to retrieve a list of customer objects.

You need to ensure that the query meets the following requirements:
* Only customers that match the following filter criteria are retrieved: City=”Seattle” AND Level > 200.
* Data is sorted in ascending order by the ContactName and Address properties.
Which URL should you use for the query?

What should you add to the service configuration file?

You are developing a Windows Communication Foundation (WCF) service.
You establish that the largest size of valid messages is 8,000 bytes. You notice that many malformed messages are being transmitted.
Detailed information about whether each message is malformed must be logged.

You need to ensure that this information is saved in XML format so that it can be easily analyzed.
What should you add to the service configuration file?

Which XPath expression should you use?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to create an application.
The application contains the following XML fragment:

<ApplicationMenu>
<MenuItem name=”File”>
<MenuItem name=”New”>
<MenuItem name=”Project” />
<MenuItem name=”Web Site” />
</MenuItem>
<MenuItem name=”Open”>
<MenuItem name=”Project” />
<MenuItem name=”Web Site” />
</MenuItem>
<MenuItem name=”Save” />
</MenuItem>
<MenuItem name=”Edit”>
<MenuItem name=”Cut” />
<MenuItem name=”Copy” />
<MenuItem name=”Paste” />
</MenuItem>
<MenuItem name=”Help”>
<MenuItem name=”Help” />
<MenuItem name=”About” />
</MenuItem>
</ApplicationMenu>

The application queries the XML fragment by using the XmlDocument class. You need to select all the descendant
elements of the MenuItem element that has its name attribute as File. Which XPath expression should you use?

Which two actions should you recommend?

You are designing an ASP.NET Web application that will queue e-mail messages in a database.
A Windows service will process the queue and send the messages.
The Web application will be hosted on a server that hosts several other applications.
The server cannot support additional processors or memory.
You estimate that the Web application usage will increase by 10 percent every month.
You need to ensure that the delivery of high-priority messages will not be delayed as the Web application usage increases.
Which two actions should you recommend?
(Each correct answer presents part of the solution. Choose two.)

Which code segment should you use?

You are developing a new version of an existing message contract named CustomerDetailsVersion1.
The new version of the message contract must add a Department field of type String to the SOAP header.
You create a new class named CustomerDetailsVersion2 that inherits from CustomerDetailsVersion1.

You need to ensure that all client applications can consume the service. Which code segment should you use?