PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

You need to ensure that the stack trace details of the exception are not included in the error information sen

You are creating a Windows Communication Foundation (WCF) service that is implemented
as follows. (Line numbers are included for reference only.) 01|ServiceContract]
02[ServiceBehavior (includeExceptionDetàilslnFaults = true) 1 03putiic class OrderService
04{ 05[Operation Contract] 06putiic void Submit Order (Order an Order) 07{ O8try 09{ 10…
11) 12catch (DivideByZeroExcepton ex) 13{ 14 15) 16) 17) You need to ensure that the
stack trace details of the exception are not included in the error information sent to the
client. What should you do?

Which configuration should you add to the web.config file?

You are implementing an ASP.NET Web site that uses a custom server control named Task. Task is
defined as shown in the following list.
•Class name: Task
•Namespace: DevControls
•Assembly: TestServerControl.dll
•Base class: System.Web.UI.WebControls.WebControl

You copy TestServerControl.dll to the Web sites Bin folder. You need to allow the Task control to be
declaratively used on site pages that do not contain an explicit @ Register directive. Which
configuration should you add to the web.config file?

You need to add a route to meet the following requirements

You create a new ASP.NET MVC 2 Web application. The following default routes are created in the
Global.asax.cs file. (Line numbers are included for reference only.)
01 public static void RegisterRoutes(RouteCollection routes)
02 {
03 routes.IgnoreRoute(“{resource}.axd/{*pathInfo}”);
04
05 routes.MapRoute(
“Default”,
“{controller}/{action}/{id}”,
new { controller = “Home”, action = “Index”, id = “” }
);
06 }

You implement a controller named HomeController that includes methods with the following
signatures.
public ActionResult Index()
public ActionResult Details ( int id )
public ActionResult DetailsByUsername(string username)
You need to add a route to meet the following requirements.
• The details for a user must be displayed when a user name is entered as the path by invoking the
DetailsByUsername action.
• User names can contain alphanumeric characters and underscores, and can be between 3 and 20
characters long.
What should you do?

You need to ensure that client applications can initiate reports without waiting for status

You develop a Windows Communication Foundation (WCF) service to generate reports.
Client applications call the service to initiate report generation but do not wait for the reports
to be generated. The service does not provide any status to the client applications. The
service class is defined as follows. (Line numbers are included for reference only.) You
need to ensure that client applications can initiate reports without waiting for status. Which
two actions should you perform (Each correct answer presents part of the solution. Choose
two.)

Which code segment should you use?

You are implementing an ASP.NET MVC 2 Web application that contains the following class.
public class DepartmentController : Controller
{
static List<Department> departments =
new List<Department>();
public ActionResult Index()
{
return View(departments);
}
public ActionResult Details(int id)
{
return View(departments.Find(x => x.ID==id));
}
public ActionResult ListEmployees(Department d)
{
List<Employee> employees = GetEmployees(d);
return View(employees);
}}
You create a strongly typed view that displays details for a Department instance. You want the view
to also include a listing of department employees. You need to write a code segment that will call
the ListEmployees action method and output the results in place. Which code segment should you
use?

You need to configi.re WCF to ci this method when the client calls the service with the HTTP DRETE opera on Wh

You are creating a Windows Communication Foundation (WCF) service that implements
operations in a RESTful manner. You need to add a delete operation You implement the
delete method as follows. string oid Deleteltems(string id); You need to configi.re WCF to ci
this method when the client calls the service with the HTTP DRETE opera on What should
you do?