Ensurepass

 

QUESTION 81

An existing Windows Communication Foundation (WCF) service uses basicHttpBinding. You are releasing updates to the service and the client application. You need to enable the client application to flow transactions to the service. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

 

A.

Change to a custom binding that has the httpTransport, textMessageEndcoding, and transactionFlow binding elements in this order.

B.

Change to a custom binding that has the transactionFlow, textMessageEncoding, and httpTransport binding elements in this order.

C.

Change the binding to use wsHttpBinding.

D.

Change the binding to use basicHttpContextBinding.

 

Correct Answer: BC

 

 

QUESTION 82

You are developing a Windows Communication Foundation (WCF) service. The service operation takes a customer number as the only argument and returns information about the customer. The service requires a security token in the header of the message. You need to create a message contract for the service. Which code segment should you use?

 

A.

<ServiceContract()>

Public Interface IService

<OperationContract()>

Function GetCustomerInformation(

ByVal header As Header,

ByVal customerNumber As Integer)

As CustomerInformation

End Interface

<DataContract()>

Public Class CustomerInformation

End Class

<MessageContract()>

Public Class Header

<MessageHeader()>

Public SecurityTag As String

End Class

B.

<ServiceContract()>

Public Interface IService

<OperationContract()>

Function GetCustomerInformation(

ByVal header As Header,

ByVal customerNumber As Integer) As CustomerInformation

End Interface

<MessageContract()>

Public Class CustomerInformation

End Class

<MessageContract()>

Public Class Header

<MessageHeader()>

Public SecurityTag As String

End Class

C.

<ServiceContract()>

Public Interface IService

<OperationContract()>

Function GetCustomerInformation(

ByVal request As CustomerNumber) As CustomerInformation

End Interface

<DataContract()> Public Class CustomerInformation

End Class

<MessageContract()>

Public Class CustomerNumber

<MessageHeader()>

Public SecurityTag As String

<MessageBodyMember()>

Public CustomerNumberElement As Integer

End Class

D.

<ServiceContract()>

Public Interface IService

<OperationContract()>

Function GetCustomerInformation(

ByVal request As CustomerNumber) As CustomerInformation

End Interface

<MessageContract()>

Public Class CustomerInformation

End Class

<MessageContract()>

Public Class

CustomerNumber

<MessageHeader()>

Public SecurityTag As String

<MessageBodyMember()>

Public CustomerNumberElement As Integer

End Class

 

Correct Answer: D

 

 

QUESTION 83

You are developing a client application that consumes a Windows Communication Foundation (WCF) service.

 

You use the svcutil.exe utility to create a proxy for the service. You use the svcutil.exe switches that generate asynchronous calls. GetFlight is a service operation that takes no parameters and returns a string. The GetFlightCallback method must be called when the service operation returns.

 

You create an instance of the client proxy with the following code:

 

Dim client As TravelServiceClient = New TravelServiceClient()

 

You need to ensure that a callback is received when the GetFlight operation is called asynchronously.

 

Which code segment should you use?

 

A.

client.BeginGetFlight(AddressOf

GetFlightCallback, Nothing) client.GetFlight()

B.

client.GetFlight()

client.BeginGetFlight(AddressOf GetFlightCallback, Nothing)

C.

AddHandler client.GetFlightCompleted,

New EventHandler(Of GetFlightCompletedEventArgs)

(AddressOf GetFlightCallback)

client.GetFlightAsync()

D.

Dim asyncResult As IAsyncResult = client.BeginGetFlight(

AddressOf GetFlightCallback, client)

client.EndGetFlight(asyncResult)

 

Correct Answer: D

 

 

QUESTION 84

You are developing a Windows Communication Foundation (WCF) service to provide an in- memory cache for many Web applications. The service contract is defined as follows. (Line numbers are included for reference only.)

 

clip_image001

 

You need to ensure that all users share the cache.

 

Which code segment should you insert at line 07?

 

A.

[ServiceBehavior(TransactionlsolationLevel =

IsolationLevel.RepeatableRead)]

B.

[ServiceBehavior(InstanceContextMode =

InstanceContextMode.Single)]

C.

[ServiceBehavior(InstanceContextMode =

InstanceContextMode.PerSession)]

D.

[ServiceBehavior(TransactionlsolationLevel =

IsolationLevel.ReadCoromitted)]

 

Correct Answer: B

 

 

QUESTION 85

You are creating a windows Communication Foundation (WCF) service to process orders.

 

The data contract for the order is defined as follows:

 

[DataContract]>

 

public class Order

 

{

 

[DataMemberl ()>

 

public string CardHolderName { get; set;

 

[DataMember] >

 

public string CreditCardNumber { get; set; }

 

)

 

You have the following requirements:

 

clip_image003Enable the transmission of the contents of Order from the clients to the service.

clip_image003[1]Ensure that the contents of CreditCardNumber are not sent across the network in clear text.

clip_image003[2]Ensure that the contents of CreditCardNumber are accessible by the service to process the order.

 

You need to implement the service to meet these requirements

 

What should you do?

 

A.

Add a DataProtectionPermission attribute to the CreditCardNumber property and set the ProtectData property to true.

B.

Convert the DataContract to a MessageContract and set the ProtectionLevel property to SignAndEncrypt

C.

Change the data type of CreditCardNumber from string to SecureString

D.

Implement the CreditCardNumber property getter and setter In the setter, run the value of the CreditCardNumber through the MD5CryptoServiceProvider class TransformBlock method

 

Correct Answer: B

 

 

QUESTION 86

You develop a Windows Communication Foundation (WCF) RESTful service that provides media streaming services.

 

The service includes the following code. (Line numbers are included for reference only.)

 

clip_image004

 

The service must return an XML response.

 

You need to apply the correct attribute to AddMediaTitle method.

 

Which code segment should you insert at line 05?

 

A.

<WebInvoke(Method:= “POST”)>

B.

<WebInvoice (ResposeFormat:=WebMessageFormat .Xml, BodyStyle :=WebMessageBodyStyle.Bare) >

C.

<WebInvoke()>

D.

<WebInvoice(ResponseFormat :=WebMessageFormat.Xml, BodyStyle:=WebMessageBodyStyle.Wrapped)>

 

Correct Answer: D

 

 

QUESTION 87

You are developing a client application that consumes a Windows Communication Foundation (WCF) service.

 

You use the svcutil.exe utility to create a proxy for the service.

 

You use the svcutil.exe switches that generate asynchronous calls. GetFlight is a service operation that takes no parameters and returns a string. The GetFlightCallback method must be called when the service operation returns.

 

You create an instance of the client proxy with the following code:

 

var client = new TravelServiceClient();

 

You need to ensure that a callback is received when the GetFlight operation is called asynchronously.

 

Which code segment should you use?

 

A.

client.BeginGetFlight(GetFlightCallback, null);

client.GetFlight();

B.

client.GetFlight();

client.BeginGetFlight(GetFlightCallback, null);

C.

client.GetFlightCompleted +=

new EventHandler<GetFlightCompletedEventArgs>(

GetFlightCallback);

client.GetFlightAsync();

D.

IAsyncResult asyncResult = client.BeginGetFlight(

GetFlightCallback, client);

client.EndGetFlight(asyncResult);

 

Correct Answer: C

 

 

QUESTION 88

A Windows Communication Foundation (WCF) service uses the following service contract.

 

<ServiceContract>

 

Public Interface IService <OperationContract0>?

 

Function Operation 1 (RyVal s As String) As String

 

End Interface You need to ensure that the operation contract Operation 1 responds to HTTP POST requests.

 

Which code segment should you use?

 

A.

<OperationContract0> <Weblnvoke(Method:z’POST”)>

Function Operation 1 (ByVal s As String) As String

B.

<OperationContract0> <WebGet(UriTemplate: “POST’)>

Function Operation 1 (ByVal s As String) As String

C.

<OperationContract(ReplyAction: `POST”)>

Function Operation 1 (ByVal s As String) As String

D.

<OperationContract(Action:z”POST”)>

Function Operation 1 (ByVal s As String) As String

 

Correct Answer: A

 

 

QUESTION 89

A Windows Communication Foundation (WCF) solution exposes the following service over a TCP binding. (Line numbers are included for reference only.)

 

01 [ServiceContract]

 

02 [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)]

 

03 public class DataAccessService

 

04 {

 

05 [OperationContract]

 

06 public void PutMessage(string message)

 

07 {

 

08 MessageDatabase.PutMessage(message);

 

09 }

 

10 [OperationContract]

 

11 public string[] SearchMessages(string search)

 

12 {

 

13 return MessageDatabase.SearchMessages(search);

 

14 }

 

15 }

 

MessageDatabase supports a limited number of concurrent executions of its methods.

 

You need to change the service to allow up to the maximum number of executions of the methods of MessageDatabase. This should be implemented without preventing customers from connecting to the service.

 

What should you do?

 

A.

Change the service behavior as follows.

[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple,

InstanceContextMode = InstanceContextMode.Single)]

B.

Change the service behavior as follows.

[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Single,

InstanceContextMode = InstanceContextMode.PerSession)]

C.

Add a throttling behavior to the service, and configure the maxConcurrentCalls.

D.

Add a throttling behavior to the service, and configure the maxConcurrentSessions.

 

Correct Answer: C

 

 

QUESTION 90

You are developing a Windows Communication Foundation (WCF) service. You need to enable security auditing for all events. What should you do?

 

A.

Set the serviceAuthorizationAuditLevel setting to Success and the messageAuthenticationAuditLevel setting to Success.

B.

Set the messageAuthenticationAuditLevel setting to Success and the auditLogLocation setting to Application.

C.

Set the serviceAuthorizationAuditLevel setting to SuccessAndFailure and the messageAuthenticationAuditLevel setting to SuccessAndFailure.

D.

Set the messageAuthenticationAuditLevel setting to SuccessAndFailure and the auditLogLocation setting to Security.

 

Correct Answer: C

 

Instant Access to Download Latest Complete Collection of Microsoft 70-513 Real Exam

Try Microsoft 70-513 Free Demo