PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

Which two actions should you perform?

You are implementing an ASP.NET Web site. The Web site contains a Web service named
CustomerService. The code-behind file for the CustomerService class contains the following code
segment.
public class ProductService : System.Web.Services.WebService
{
public List<Product> GetProducts(int categoryID)
{
return GetProductsFromDatabase(categoryID);
}}
You need to ensure that the GetProducts method can be called by using AJAX. Which two actions
should you perform? (Each correct answer presents part of the solution. Choose two.)

You need to ensure that only users with the Manager role can call the ApproveOrder method

You are creating a Windows Communication Foundation (WCF) service that implements the
following service contract. [ServiceContract] public interface IOrderProcessing {
[OperationContract] void ApproveOrder(int id); } You need to ensure that only users with the
Manager role can call the ApproveOrder method. What should you do?

You need to ensure that Address instances that are serialized by the XmlSerializer class meet the XML format r

You are implementing an ASP.NET Web site. The site contains the following class.
Public Class Address
Public AddressType As Integer
Public Line1 As String
Public Line2 As String
Public City As String
Public ZipPostalCode As String
End Class
The Web site interacts with an external data service that requires Address instances to be given in
the following XML format.
<Address AddressType=”2″>
<Line1>250 Race Court</Line1>
<City>Chicago</City>
<PostalCode>60603</PostalCode>
</Address>
You need to ensure that Address instances that are serialized by the XmlSerializer class meet the
XML format requirements of the external data service. Which two actions should you perform (Each
correct answer presents part of the solution. Choose two.)

You need to ensure that the About action is invoked when the root URL of the site is accessed

You create a new ASP.NET MVC 2 Web application. The following default routes are created in the
Global.
asax.vb file. (Line numbers are included for reference only.) 01 Shared Sub RegisterRoutes(ByVal
routes As
RouteCollection) 03 routes.IgnoreRoute(“{resource}.axd/{*pathInfo}”)
05 routes.MapRoute(_
“Default”,
“{controller}/{action}/{id}”,
New With {.controller = “Home”, .action = “Index”, .id = “”} )
07 End Sub
You implement a controller named HomeController that includes methods with the following
signatures.
Function About() As ActionResult
Function Index() As ActionResult
Function Details(ByVal id As Integer) As ActionResult
You need to ensure that the About action is invoked when the root URL of the site is accessed. What
should you do?

What should you do?

You are creating a Windows Communication Foundation (WCF) service that accepts
messages from clients when they are started. The message is defined as follows.
[MessageContract] public class Agent { public string CodeName { get; set; } public string
SecretHandshake { get; set; } } You have the following requirements: The CodeName
property must be sent in clear text. The service must be able to verify that the property
value was not changed after being sent by the client. The SecretHandshake property must
not be sent in clear text and must be readable by the service. What should you do?

You need to ensure that requests for this URL that contain an unrecognized country value will not be processed

You are implementing an ASP.NET MVC 2 Web application.
The URL with path /Home/Details/{country} will return a page that provides information about the
named country. You need to ensure that requests for this URL that contain an unrecognized country
value will not be processed by the Details action of HomeController. What should you do?