PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

What should you do?

An application fails when executing a specific operation.
You discover that the failure occurs when an exception is raised by a Web service.
The application uses the following code to call the Web service.

void Process()
{
ProcessService serviceProxy = new ProcessService();
serviceProxy.ProcessDataCompleted += new ProcessDataCompletedEventHandler(ServiceCompleted);
serviceProxy.ProcessDataAsync(data);
}

You need to ensure that the application does not fail when the Web service raises the exception.
Your solution must maximize the performance of your code.

What should you do?

Which two actions should you perform?

You are writing an application that handles the batch processing of user accounts.
The application assigns network identities for users by calling the following Web service method.

[WebMethod]
public string GetNetworkID(string name)
{ …}

The application calls the Web
service using the following code.

(Line numbers are included for reference only.)
01 void ProcessPeople(List<Person> people) {
02 PersonService serviceProxy = new PersonService();
03 serviceProxy.GetNetworkIDCompleted += new
04 GetNetworkIDCompletedEventHandler(GetNetworkIDCompleted);
05 for (int i = 0; i < people.Count;i++) {
06 …
07 }
08 }
09
10 void GetNetworkIDCompleted(object sender,
11 GetNetworkIDCompletedEventArgs e){
12 Person p = null;
13 …
14 p.NetworkID = e.Result;
15 ProcessPerson(p);
16 }

You need to ensure that the application can use the data supplied by the Web service to update each Person instance. Which two actions should you perform? (Each correct answer
presents part of the solution. Choose two.)

Which type or types of data access are allowed?

You are configuring a ClickOnce deployment that allows users to install your application from the Internet zone under partial trust permissions. You want the application to access data that resides on the same remote server from which the application is installed. You need to add one or more types of data access that are allowed under partial trust permissions to your application. Which type or types of data access are allowed? (Choose all that apply.)

What should you do?

A class library named MathLib contains the following code.

public class MathClass : MarshalByRefObject
{
public decimal DoHugeCalculation(int iterations)
{
decimal result;
//Some very lengthy calculations …
return result;
}
}

The MathLib class is hosted in a .NET Framework remoting server application.
A Windows application project running on a client computer contains the following class.

public class MathClient
{
public void ProcessHugeCalculation(int iterations)
{
MathClass cm = new MathClass();
decimal decRes = cm.DoHugeCalculation(iterations);
//process the result …
}
}

The MathClient class must call the MathClass class asynchronously by using remoting.
A callback must be implemented to meet this requirement.
You need to complete the implementation of the MathClient class.

What should you do?

What should you do?

You are writing a .NET Framework remoting client application that must call two remoting servers.
The first server hosts an assembly that contains the following delegate and class definition.

public delegate bool IsValidDelegate(string number, Int16 code);

public class CreditCardValidator : MarshalByRefObject
{
public bool IsValid (string number, Int16 code)
{
//some data access calls that are slow under heavy load …
}
}

The second server hosts an assembly that contains the following delegate and class definition.

public delegate float GetCustomerDiscountDelegate( int customerId);

public class PreferredCustomer
{
public float GetCustomerDiscount(int customerId)
{
//some data access calls that are slow under heavy load …
}
}

You configure the remoting client application to call both server classes remotely.
The amount of time it takes to return these calls varies, and long response times occur during heavy load times.
The processing requires the result from both calls to be returned.
You need to ensure that calls to both remoting servers can run at the same time.

What should you do?