PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

You need to configure the ObjectDataSource control to pass the value of the pid field to GetProductsByProductI

You are implementing an ASP.NET page. You add and configure the following ObjectDataSource.

The page will be called with a query string field named pid. You need to configure the
ObjectDataSource control to pass the value of the pid field to GetProductsByProductId method.
What should you do?

Which code segment should you use?

You are implementing an ASP.NET page. Client-side script requires datA. Your application includes a
class named Person with a Name property of type string. The code-behind file of the page includes
the following code segment.
public string JsonValue;
List<Person> people = GetPeopleList();
JavaScriptSerializer json = new JavaScriptSerializer();
You need to use the JavaScriptSerializer class to serialize only the Name property of each item in the
people list. Which code segment should you use?

Which code segment should you use?

You are developing a Windows Communication Foundation (WCF) service that contains the
following code segment. [ServiceContract ] public interface ICustomerService { & } public
class CustomerService : ICustomerService { & } The service is self-hosted in a console

application. Older client applications access the service at
http://contoso.com:8080/CustomerService/V1. Newer client applications access the service
at http://contoso.com:8080/CustomerService/V2. You need to ensure that any client
application can access the service at either address. Which code segment should you use?

You need to display the items in a table named Products by using a custom layout

You are implementing an ASP.NET Dynamic Data Web site. The Web site includes a data context that
enables automatic scaffolding for all tables in the data model. The Global.asax.cs file contains the
following code segment.
public static void RegisterRoutes(RouteCollection routes) {
{
routes.Add(new DynamicDataRoute(“{table}/ListDetails.aspx”)
{
Action = PageAction.List,
ViewName = “ListDetails”,
Model = DefaultModel
});
routes.Add(new DynamicDataRoute(“{table}/ListDetails.aspx”)
{
Action = PageAction.Details,
ViewName = “ListDetails”,
Model = DefaultModel
});
}
You need to display the items in a table named Products by using a custom layout. What should you
do?

You need to ensure that the service is configured to process multiple orders in one transaction

Your company has an existing Windows Communication Foundation (WCF) service that
allows business partners to place orders. The service uses netMsmqBinding. You find that
processing every order in its own transaction is causing a delay. You need to ensure that
the service is configured to process multiple orders in one transaction. What should you do?

Which attribute should you apply to the MessageProcessor class?

You are modifying an existing Windows Communication Foundation (WCF) service that is
defined as follows. [ServiceContract] public interface IMessageProcessor {
[OperationContract] void ProcessMessage (); } public class MessageProcessor :
IMessageProcessor { public void ProcessMessage () { & Sub mitOrder (); & } } SubmitOrder
makes a call to another service. The ProcessMessage method does not perform as
expected under a heavy load. You need to enable processing of multiple messages. New
messages must only be processed when the ProcessMessage method is not processing
requests, or when it is waiting for calls to SubmitOrder to return. Which attribute should you
apply to the MessageProcessor class?

Which two actions should you perform?

You are developing an ASP.NET Web service. The following code segment implements the service.
(Line numbers are included for reference only.)
01 [WebServiceBinding(ConformsTo =
WsiProfiles.BasicProfile1_1)]
02 public class ProductService :
System.Web.Services.WebService
03 {
04 [WebMethod]
05 public Product GetProduct(string name)
06 {
07
08 }
09
10 [WebMethod]
11 public Product GetProduct(int id)
12 {
13
14 }
15 }
You need to ensure that both GetProduct methods can be called from a Web client. Which two
actions should you perform? (Each correct answer presents part of the solution. Choose two.)