Ensurepass

QUESTION 251

You are developing a Windows Communication Foundation (WCF) service. The service needs to access out-of-process resources. You need to ensure that the service accesses these resources on behalf of the originating caller. What should you do?

 

A.

Set the value of ServiceSecurityContext.Current.WindowsIdentity.ImpersonationLevel to TokenImpersonationLevel.Impersonation.

B.

Set the value of ServiceSecurityContext.Current.WindowsIdentity.ImpersonationLevel to TokenImpersonationLevel.Delegation.

C.

Set the PrincipalPermissionAttribute on the service contract and update the binding attribute in the endpoint element of the configuration file to wsHttpBinding.

D.

Set the PrincipalPermissionAttribute on the service contract and update the bindingConfiguration attribute in the endpoint element of the configuration file to wsHttpBinding.

 

Correct Answer: B

 

 

QUESTION 252

You are developing a Windows Communication Foundation (WCF) service to provide shopping cart support. ASP.NET compatibility mode is not enabled. The shopping cart information must be retained across user visits to the store until the user explicitly empties the cart or submits the cart contents to order. You need to implement the service as a DurableService. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

 

A.

Use basicHttpBinding for both the client application and the service.

B.

Create the persistence provider database and configure the persistenceProvider element of the service behavior to point to that database.

C.

Use wsHttpContextBinding for both the client application and the service.

D.

In the method to add an item to the shopping cart, serialize the shopping cart contents after adding the current item and storing it in a Session variable.

 

Correct Answer: BC

 

 

QUESTION 253

You have an existing Windows Communication Foundation (WCF) service that exposes a service contract over HTTP using explicit binding configuration. You need to expose that contract over HTTP and TCP. What should you do?

 

A.

Add a net.tcp base address to the host.

B.

Add an endpoint configured with a netTcpBinding.

C.

Add an endpoint behavior named netTcpBehavior to the existing endpoint.

D.

Add a binding configuration to the existing endpoint named netTcpBinding.

 

Correct Answer: B

 

 

QUESTION 254

A Windows Communication Foundation (WCF) client uses the following service contract. (Line numbers are included for reference only.)

 

01 [ServiceContract]

 

02 public interface IService

 

03 (

 

04 [OperationContractj

 

05 string Operation1O;

 

06 [OperationContract]

 

07 string Operation2(),

 

08)

 

You need to ensure that all calls to Operation 1 and Operation2 from the client are encrypted and signed.

 

What should you do?

 

A.

Set the ProtectionLevel property in line 01 to EncryptAndSign.

B.

Set the ProtectionLevel property in line 04 and line 06 to Sign.

C.

Add a SecurityCriticalAttribute ror each operation.

D.

Add a SecunitySafeCriticalAttribute for each operation.

 

Correct Answer: A

 

 

QUESTION 255

You are developing a custom service host for a Windows Communication Foundation (WCF) service. The service host is named MovieServiceHost. You need to deploy the service with the custom service host in Microsoft Internet Information Services (IIS) 7.0. What should you do?

 

A.

Create a factory for the custom service host. Name the factory MovieServiceHostFactory.

In the web.config file, add the following attribute to the <add> element within the <serviceActivations> element, factory=”HovieServiceHostFactory”

B.

Decorate the custom service host class with the following line.

<System.ServiceModel.Activation.ServiceActivationBuildProvider()>

C.

Make sure that the service class has a default constructor.

Add a public read-only property with the name ServiceHost that returns an instance of the MovieServiceHost class.

D.

Create a factory for the custom service host. Name the factory MovieServiceHostFactory.

In the .svc file, add the following line. <%3 ServiceHost Service=”MovieServiceHostFactory” Language=”VB”%>

 

Correct Answer: A

 

 

QUESTION 256

You are developing a Windows Communication Foundation (WCF) client application. You instantiate a client class that inherits from ClientBase. The client instance must always be shut down in such a way that it can free up any resources it is referencing. You need to ensure that all exceptions are caught and the instance is always properly shut down. Which code segment should you use?

 

clip_image002

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: D

 

 

QUESTION 257

You are creating a Windows Communication Foundation (WCF) service based on WSHttpBinding. New audit requirements dictate that callers must be authenticated on every call to ensure that their credentials have not been revoked. You need to ensure that the service will not cache the security request token. What should you do?

 

A.

Apply a ServiceBehavior attribute to the service implementation class with the InstanceContextMode property set to Single.

B.

In the message security configuration, change clientCredentialType from IssuedToken to UserName.

C.

In the message security configuration, set establishSecurityContext to false.

D.

At the end of every operation, call the SessionStateUtility.RaiseSessionEnd method.

 

Correct Answer: C

 

 

QUESTION 258

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 259

You are developing a Windows Communication Foundation (WCF) service. You establish that the largest size of valid messages is 8,000 bytes. You notice that many malformed messages are being transmitted. Detailed information about whether each message is malformed must be logged. You need to ensure that this information is saved in XML format so that it can be easily analyzed. What should you add to the service configuration file?

 

A.

<messageLogging

logMessagesAtServiceLevel=”true”

logMessagesAtTransportLevels”true”

maxMessagesToLog=”1000″

maxSizeOfMessageToLog=”8000″/>

B.

<roessageLogging

logEntireMessage=”true”

logNalformedMessages=”false”

logMessagesAtServiceLeve1=”true”

logMessagesAtTransportLevel=”true”

maxMessagesToLog””1000″/>

C.

<message Logging

logEntireMessage=”true”

logHalformedMessages””false”

logMessagesAtServiceLevel-“true”

logMessagesAtTransportLevel-“true”

maxMessagesToLog=”1000″

maxSizeOfMessageToLog=”8000″/>

D.

<messageLogging

logEnt ireMessage=”true”

logHalformedMessages=”true”

logMessagesAtServiceLevel=”true”

logMessagesAtTranspoctLevel=”true”

maxMessagesToLog=”1000″

maxSizeOfMessageToLog=”100000″/>

 

Correct Answer: D

Explanation:

To log malformed message we should set logMalformedMessages=”true”, only D met this requirement.

 

 

QUESTION 260

A Windows Communication Foundation (WCF) service is required to log all authorization attempts to the Windows Event Log. You need to configure a behavior and apply it to the service to support this requirement. Which behavior should you configure and apply?

 

A.

serviceAuthenticationManager

B.

serviceAuthorization

C.

serviceCredentials

D.

serviceSecurityAudit

 

Correct Answer: D

 

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

Try Microsoft 70-513 Free Demo