Ensurepass

QUESTION 281

You implement a Windows Communication Foundation (WCF) service. You must process all of the valid SOAP messages that the service receives. What should you do?

 

A.

On the OperationContractAttribute, call the Match method.

B.

Call the Message.CreateMessage static method. Pass the value MessageVersion.Default as a parameter.

C.

On the OperationContractAttribute of a method, set the value of the Action and ReplyAction properties to *.

D.

On the OperationContractAttribute of a method, set the value of the Action and ReplyAction properties to ?.

 

Correct Answer: A

 

 

QUESTION 282

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?

 

A.

In the method body, check the Rights.PossessProperty property to see if it contains Manager.

B.

Add a PrincipalPermission attribute to the method and set the Roles property to Manager.

C.

Add a SecurityPermission attribute to the method and set the SecurityAction to Demand.

D.

In the method body, create a new instance of WindowsClaimSet.

Use the FindClaims method to locate a claimType named Role with a right named Manager.

 

Correct Answer: B

 

 

QUESTION 283

You are implementing a Windows Communication Foundation (WCF) service contract named IContosoService in a class named ContosoService. The service occasionally fails due to an exception being thrown at the service. You need to send the stack trace of any unhandled exceptions to clients as a fault message. What should you do?

 

A.

In the application configuration file on the client, add the following XML segment to the system.serviceModel/behaviors configuration section group.

<endpointBehaviors>

<behavior name=” debug “>

< callback Debug includeExceptionDetailInFaults=”true” />

</behavior>

</endpointBehaviors>

Associate the debug behavior with any endpoints that need to return exception details.

B.

In the application configuration file on the service and all the clients, add the following XML segment to the system.diagnostics/sources configuration section group. <source name=”System.ServiceModel” switchValue=”Error” propagateActivity=”true”>

<listeners>

<add name=”ServiceModelTraceListener”

initializeData=”app_tracelog.svclog”

type=”System.Diagnostics.XmlWriterTraceListener” /> </listeners>

</source>

C.

Apply the following attribute to the ContosoService class.

[ServiceBehavior(IncludeExceptionDetailInFaults = true)]

D.

For each OperationContract exposed by IContosoService, apply the following attribute.

[FaultContract(typeof(Exception))]

 

Correct Answer: C

 

 

QUESTION 284

A Windows Communication Foundation (WCF) solution uses two services to manage a shopping cart. Service A processes messages containing line items that total between $0 and $500. Service B processes messages containing line items that total more than $500. All messages are of equal importance to the business logic. You need to route incoming messages to the appropriate services by using WCF routing. Which two message filters should you add to the router? (Each correct answer presents part of the solution. Choose two.)

 

A.

a message filter with a priority of 100 that will forward messages that total between $0 and $500 to Service A

B.

a message filter with a priority of 0 that will forward messages that total between $0 and $500 to Service A

C.

a message filter with a priority of 0 that will forward all messages to Service B

D.

a message filter with a priority of 100 that will forward all messages to Service B

 

Correct Answer: AC

 

 

QUESTION 285

A WCF service code is implemented as follows. (Line numbers are included for reference only)

 

01 [ServiceContract]

 

02 [ServiceBehavior(lnstanceContextMode =

 

03 lnstanceContextModeSingle)]

 

04 public class CalculatorService

 

05 {

 

06 [OperationContract]

 

07 public double Calculate(double op1, string op. double op2)

 

08 {

 

24 }

 

25 }

 

You need to increase the rate by which clients get the required response from the service.

 

What e two possible ways to achieve this goal? (Each correct answer presents a complete sokiion Choose two.)

 

A.

Change the service behavior to the following.

[ServiceBehavior(

lnstanceContextMode = lnstanceContextModeSingle,

ConcirrencyMode = ConcurrencyMode. Multide)]c

B.

Change the service behavior to the following.

[ServiceBehavior(lnstanceContextMode = lnstanceContextMode.PerCall)]

C.

Require the clients use threads, the Parallel Task Library, or other mechanism to issue service calls in parallel.

D.

Require the clients to use async operations when calling the senvice.

 

Correct Answer: AB

 

 

QUESTION 286

You are developing a windows Communication Foundation (WCF) service that will be hosted in Microsoft Intemnet Information Services (IIS) 7.0. The service must be hosted in an lIs application named Info. You need to enable this senvice to be hosted in llS by changing the web.config file. Which XML segment should you add to the web.config file?

 

clip_image002

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: B

 

 

QUESTION 287

You have an existing Windows Communication Foundation (WCF) service. You need to ensure that other services are notified when the service is started. What should you do?

 

A.

Add the following standard endpoint to the service.

<endpoint name=”udpAnnouncementEndpoint”

kind=”udpDiscoveryEndpoint” />

B.

Add the following standard endpoint to the service.

<endpoint name=”udpDiscoveryEndpoint”

kind=”udpAnnouncementEndpoint” />

C.

Add a service behavior with the following element.

<serviceDiscovery>

<announcementEndpoints>

<endpoint kind=”udpDiscoveryEndpoint” />

</announcementEndpoints>

</serviceDiscovery>

D.

Add a service behavior with the following element.

<serviceDiscovery>

<announcementEndpoints>

<endpoint kind=”udpAnnouncementEndpoint” />

</announcementEndpoints>

</serviceDiscovery>

 

Correct Answer: A

 

 

QUESTION 288

DRAG DROP

You are preparing to deploy a Windows Communication Foundation (WCF) service to a production environment. The service must not be vulnerable to a man-in-the-middle attack. You need to configure the service to use X.509 certificate security. Which four actions should you perform in sequence? (To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.)

 

clip_image004

 

Correct Answer:

clip_image006

 

 

QUESTION 289

You develop a Windows Communication Foundation (WCF) service that contains the following code segment. (Line numbers are included for reference only.)

 

clip_image008

 

You need to ensure that all service endpoints are available to client applications. Which code segment should you insert at line 04?

 

clip_image010

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: D

 

 

QUESTION 290

You are developing a Windows Communication Foundation (WCF) service. The service configuration file has a <System.Diagnostics> element defined. You need to ensure that all security audit information, trace logging, and message logging failures are recorded. Which configuration segment should you add to the <System.Diagnostics> element?

 

clip_image012

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: C

 

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

Try Microsoft 70-513 Free Demo