PrepAway - Latest Free Exam Questions & Answers

Category: 70-513

Exam 70-513: TS: Windows Communication Foundation Development with Microsoft .NET Framework 4

What should you do?

A client application calls a Windows Communication Foundation (WCF) service with a proxy class that was generated by Visual Studio.
The service binding was changed from wsHttpBinding to basicHttpBinding. The method signatures in the service contract are changed.
After these changes, the client application receives errors when calling methods on the service.
You need to ensure that the client can invoke methods on the service successfully. What should you do?

What should you do?

A Windows Communication Foundation (WCF) service is hosted in Microsoft Internet Information Services (IIS).
You are preparing the configuration file for production deployment. You need to set up tracing so that an administrator can adjust
the System.ServiceModel trace level without causing the ASP.NET host application domain to restart.
You need to ensure that tracing is turned off by default. What should you do?

Which two actions should you perform?

You are developing a Windows Communication Foundation (WCF) service to provide an in-memory cache.
The following code is part of your solution. (Line numbers are included for reference only.)

01
02 public interface IInMemoryCacheService
03 {
04 [OperationContract()]
05 string GetCachedItem(string key);
06
07 [OperationContract()]
08 void CacheItem(string key, string item);
09
10 }
11
12 [ServiceBehavior(InstanceContextMode=InstanceContextMode.Single)]
13 public class CacheService : IInMemoryCacheService
14 {
15
16 Hashtable cache = new Hashtable();
17
18 public string GetCachedItem(string key)
19 {
20 return cache(key).ToString();
21 }
22
23 public void CacheItem(string key, string item)
24 {
25 if (cache.Contains(key))
26 cache.Remove(key);
27 cache.Add(key, item);
28 }
29 }

Users report that the cache is getting updated with cache changes of other users.
You need to ensure that each user’s cache is maintained and isolated from other users.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

What should you do?

You are developing a Windows Communication Foundation (WCF) service to replace an existing ASMX Web service.
The WCF service contains the following code segment. (Line numbers are included for reference only.)

01 [ServiceContract()]
02
03 public interface IEmployeeService
04 {
05 [OperationContract()]
06 EmployeeInfo GetEmployeeInfo(int employeeID);
07
08 }
09
10 public class EmployeeService : IEmployeeService
11 {
12
13 public EmployeeInfo GetEmployeeInfo(int employeeID)
14 {
15 …
16 }
17 }
18
19
20 public class EmployeeInfo
21 {
22 …
23 public int EmployeeID { get; set; }
24 public string FirstName { get; set; }
25 public string LastName { get; set; }
26
27 }

The existing Web service returns the EmployeelD as an attribute of the Employeelnfo element in the response XML.
You need to ensure that applications can consume the service without code changes in the client. What should you do?

What should you do?

You are developing a Windows Communication Foundation (WCF) service that contains the following service contract.

[ServiceContract()]
public interface IPaymentService
{
[OperationContract()]
void RecordPayments(Person person);
}

public class Person
{ … }
public class Employee : Person
{ … }
public class Customer : Person
{ … }

You need to ensure that RecordPayments can correctly deserialize into an Employee or a Customer object.
What should you do?

What should you do?

You are modifying a Windows Communication Foundation (WCF) service that allows customers to update financial data.
The service currently requires a transaction from the client application and is working correctly.
The service contract is defined as follows. (Line numbers are included for reference only.)

01 [ServiceContract()]
02 public interface IDataUpdate
03 {
04 [OperationContract()]
05 [TransactionFlow(TransactionFlowOption.Mandatory)]
06 void Update(string accountNumber, double amount);
07
08 }
09
10 public class UpdateService : IDataUpdate
11 {
12
13 [OperationBehavior(TransactionScopeRequired=true, TransactionAutoComplete=true)]
14 public void Update(string accountNumber, double amount)
16 {
17 try
18 {
19 …
20 }
19 catch(Exception ex)
20 {
21 …
22 }
23 }
24 }

The service must be modified so that client applications do not need to initiate a transaction when calling the operation.
The service must use the client applications transaction if one is available. Otherwise it must use its own transaction.
You need to ensure that the service operation is always executed within a transaction. What should you do?

What are two possible ways to achieve this goal?

You are developing a Windows Communication Foundation (WCF) service that returns location information
for authorized law enforcement agencies. The service contract is as follows:

[ServiceContract]
public interface IMappingService
{
[OperationContract]
long[] GetLocationCoordinates(String cityName);
[OperationContract]
long[] GetLocationOfCitizen(String ssn);
}

Users are authenticated and impersonated. The system uses ASP.NET roles.
The members of law enforcement are members of the LawEnforcement role.
You need to ensure that only members of the LawEnforcement role can call these methods.
What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)


Page 4 of 15« First...23456...10...Last »