PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

Which code segment should you insert at line 04?

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application. The application connects to a Microsoft SQL Server database. The application uses the following object query to load a product from the database. (Line numbers are included for reference only.)

01using (AdventureWorksEntities advWorksContext = new AdventureWorksEntities())
02{
03ObjectQuery <Product> productQuery = advWorksContext.Product.Where(“it.ProductID = 900”);
04
05}

You need to log the command that the query executes against the data source. Which code segment should you insert at line 04?

Which XML segment should you add to the system.serviceModel configuration section of the web.config file?

Four Windows Communication Foundation (WCF) services are hosted in Microsoft Internet Information Services (IIS). No behavior configuration exists in the web.config file. You need to configure the application so that every service and endpoint limits the number of concurrent calls to 50 and the number of concurrent sessions to 25. Which XML segment should you add to the system.serviceModel configuration section of the web.config file?

Which code segment should you use?

You are creating an ASP.NET Web site. You create a HTTP module named CustomModule, and you register the module in the web.config file.
The CustomModule class contains the following code.

public class CustomModule : IHttpModule
{
string footerContent = “<div>Footer Content</div>”;
public void Dispose() {}
}

You need to add code to CustomModule to append the footer content to each processed ASP.NET page.
Which code segment should you use?

Which two actions should you perform?

You are adding a Windows Communication Foundation (WCF) service to an existing application. The application is configured as follows. (Line numbers are included for reference only.)
01 <configuration>
02 <system.serviceModel>
03 <services>
04 <service name=”Contoso.Sales.StockService”
05 behaviorConfiguration=”MetadataBehavior”>
06 <host>
07 <baseAddresses>
08 <add baseAddress=”http://contoso.com:8080/StockService” />
09 </baseAddresses>
10 </host>
11 </service>
12 </services>
13 <behaviors>
14 <serviceBehaviors>
15 <behavior name=”MetadataBehavior”>
16 </behavior>
17 </serviceBehaviors>
18 </behaviors>

You need to configure the service to publish the service metadata. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

Which message encoding should you use?

A Windows Communication Foundation (WCF) service is responsible for transmitting XML documents between systems. The service has the following requirements: It must minimize the transmission size by attaching the XML document as is without using escape characters or base64 encoding. It must interoperate with systems that use SOAP but are not built on the .NET platform. You need to configure the service to support these requirements. Which message encoding should you use?