Ensurepass

QUESTION 291

A Windows Communication Foundation (WCF) service is self-hosted in a console application. The service implements the ITimeService service interface in the TimeService class. You need to configure the service endpoint for HTTP communication. How should you define the service and endpoint tags?

 

A.

Define the service tag as follows:

<service name=”ITimeService”>

Define the endpoint tag as follows.

< endpoint kind =”TimeService”

address=”http://localhost:8080/TimeService”

binding=”wsHttpBinding”

contract=”ITimeService”/>

B.

Define the service tag as follows:

<service name=”TimeService”>

Define the endpoint tag as follows.

< endpoint kind=”TimeService”

address=”http://localhost:8080/TimeService”

binding=”wsHttpBinding”

contract=”ITimeService”/>

C.

Define the service tag as follows:

<service name=”ITimeService”>

Define the endpoint tag as follows.

< endpoint name=”TimeService”

ddress=”http://localhost:8080/TimeService”

binding=”wsHttpBinding”

contract=”ITimeService”/>

D.

Define the service tag as follows:

<service name=”TimeService”>

Define the endpoint tag as follows.

<endpoint address=”http://localhost:8080/TimeService”

binding=”wsHttpBinding”

contract=”ITimeService”/>

 

Correct Answer: D

 

 

 

 

 

 

 

 

 

 

 

QUESTION 292

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

 

[ServiceContract]

 

public interface IService

 

{

 

[OperationContract]

 

string Operation 1 (string s);

 

}

 

You need to ensure that the operation contract Operationi responds to HTTP POST requests.

 

Which code segment should you use?

 

A.

[OperationContract| [Weblnvoke(Method POST)]

string Operationl(string s);

B.

[OperationContract| [WebGet(UriTemplate = POST’)]

string Operation 1 (string s);

C.

[OperationContract(ReplyAction z `POST’)J

string Operationi (string s);

D.

[OperationContract(Action WPOST)1

string Operationl(string s);

 

Correct Answer: A

 

 

QUESTION 293

A Windows Communication Foundation (WCF) service exposes two operations: OpA and OpB OpA needs to execute under the client’s identity, and OpB needs to execute under the service’s identity. You need to configure the service to run the operations under the correct identity. What should you do?

 

A.

Set the ImpersonateCallerForAllOperations property of the service’s

ServiceAuthorizationBehavior to true.

Apply an OperationBehavior attribute to OpA and set the Impersonation property to ImpersonationOption Required.

Apply an OperationBehavior attribute to OpB and set the Impersonation property to ImpersonationOptionAulowed.

B.

Set the ImpersonateCallerForAllOperations property of the service’s ServiceAuthorizationBehavior to true.

Apply an OperationBehavior attribute to OpA and set the Impersonation property to ImpersonationOption.Allowed

Apply an OperationBehavior attribute to OpB and set the Impersonation property to ImpersonationOptionNotAllowed.

C.

Set the ImpersonateCallerForAllOperations property of the service’s ServiceAuthorizationBehavior to false.

Apply an OperationBehavior attribute to OpA and set the Impersonation property to ImpersonationOptionAllowed.

Apply an OperationBehavior attribute to OpB and set the Impersonation property to ImpersonationOptionNotAllowed.

D.

Set the ImpersonateCallerForAllOperations property of the service’s ServiceAuthorizationBehavior to false.

Apply an OperationBehavior attribute to OpA and set the Impersonation property to lmpersonationOption.Required.

Apply an OperationBehavior attribute to OpB and set the Impersonation property to ImpersonationOption.Allowed.

 

Correct Answer: D

 

 

QUESTION 294

You are creating a client application and configuring it to call a Windows Communication Foundation (WCF) service. When the application is deployed, it will be configured to send all messages to a WCF routing service. You need to ensure that the application can consume the target service after the application is deployed. What should you do?

 

A.

In the client application, add a service reference to the router service. In the client binding configuration, specify the address of the router service.

B.

In the client application, add a service reference to the target service. In the client binding configuration, specify the address of the target service.

C.

In the client application, add a service reference to the router service. In the client binding configuration, specify the address of the target service.

D.

In the client application, add a service reference to the target service. In the client binding configuration, specify the address of the router service.

 

Correct Answer: D

 

 

QUESTION 295

You develop a Window Communication Foundation (WCF) service.

 

You have the following requirements:

 

clip_image002Create a data contract to pass data between client applications and the service.

clip_image002[1]Create the data that is restricted and cannot pass between client applications and the service.

 

You need to implement the restricted data members.

 

Which member access modifier should you use?

 

A.

Private

B.

Protected

C.

Public

D.

Static

 

Correct Answer: C

 

 

 

 

 

 

 

 

QUESTION 296

You are modifying an existing Windows Communication Foundation (WCF) service that is defined as follows;

 

clip_image003

 

SubmitOrder makes a call to another service.

 

The ProcessMessage method does not perform as expected under a heavy load you need to enable processing of multiple messages.

 

New messages must only be processed when the ProcessMessage method is not processing requests, or when it is waiting for calls to SubmitOrder to return.

 

Which attribute should you apply to the MessageProcessor class?

 

A.

CallbackBehavior (ConcurrencyMode: ConcurrencyMode Reentrant)

B.

CallbackBehavior (ConcurrencyMode:=ConcurrencyModeMuttiple)

C.

ServiceBehavior (Conc urrencyMode: =Conc urrencyMode. Reentrant)

D.

ServiceBehavior (ConcurrencyMode ConcurrencyMode Multiple)

 

Correct Answer: A

 

 

QUESTION 297

You are creating an application that consumes a Windows Communication Foundation (WCF) service. The service implements the IService contract. The client application contains the CallbackHandler class, which implements IServiceCallback. You need to ensure that a client proxy is created that can communicate with the service over a duplex channel. Which code segment should you use?

 

A.

Dim handler = New CallbackHandler()

Dim clientFactory =

New DuplexChannelFactory(Of IService)(

New WSHttpContextBinding() )

Dim client = clientFactory.CreateChannel( New InstanceContext(handler),

New EndpointAddress (“¡¤¡¤¡¤”))

B.

Dim handler = New CallbackHandler()

Dim clientFactory =

New DuplexChannelFactory( Of IService)(

GetType(CallbackHandler),

New USDualHttpBindingO )

Dim client = clientFactory.CreateChannel(

New InstanceContext (handler) ,

New EndpointAddress (“¡¤¡¤¡¤”) )

C.

Dim handler – New CallbackHandler()

Dim clientFactory =

New DuplexChannelFactory(Of IService)(

GetType(CallbackHandler),

New HSDualHttpBindingO) Dim client = clientFactory.CreateChannel(

New EndpointAddress (“¡¤¡¤¡¤”) )

D.

Dim handler = New CallbackHandler()

Dim clientFactory =

New DuplexChannelFactory(Of IService)( New WSHttpBinding())

Dim client = clientFactory.CreateChannel(

New InstanceContext(handler),

New EndpointAddress (“¡¤¡¤¡¤”))

 

Correct Answer: B

 

 

QUESTION 298

You are creating a Windows Communication Foundation (WCF) service that accepts claims-based tokens. You need to ensure that the service can use claims from trading partners even though there are variations on naming for the same elements. Which two actions should you perform? (Each correct answer presents part of the solution Choose two.)

 

A.

Register a custom Service Authorization Manager that implements Check Access In this method, use System. Convert. Change Type to transform the incoming claim set to a Windows Claim Set type.

B.

Apply a Principal Permission attribute on the operation with the required claims listed in the Roles property.

C.

Within the operation, verify the presence of the required claims in the current Authorization Context

D.

Register an Authorization Policy that maps external claims to an internal Claim Set.

 

Correct Answer: CD

 

 

 

 

 

 

 

 

 

 

QUESTION 299

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

 

clip_image004

 

You need to ensure that the following XML segment is generated when the data contract is serialized.

 

clip_image005

 

Which code segment should you use?

 

A.

[DataMember]

public string firstName;

[DataMember]

public string lastName;

[DataMember(EmitDefaultValue = true)]

public int age = 0 ;

[DataMember(EmitDefaultValue = true)]

public int ID = 999999999;

B.

[DataMember(EmitDefaultValue = false)]

public string firstName = null;

[DataMember(EmitDefaultValue = false)]

public string lastName = null;

[DataMember(EmitDefaultValue = true)]

public int age = -1;

[DataMember(EmitDefaultValue = false)]

public int ID = 999999999;

C.

[DataMember(EmitDefaultValue = true)]

public string firstName;

[DataMember(EmitDefaultValue = true)]

public string lastName;

[DataMember(EmitDefaultValue = false)]

public int age = -1;

[DataMember(EmitDefaultValue = false)]

public int ID = 999999999;

D.

[DataMember]

public string firstName = null;

[DataMember] public string lastName = null;

[DataMember(EmitDefaultValue = false)]

public int age = 0;

[DataMember(EmitDefaultValue = false)]

public int ID = 999999999;

 

Correct Answer: D

 

 

QUESTION 300

You are developing a Windows Communication Foundation (WCF) service that allows customers to update financial data.

 

The client applications call the service in a transaction. The service contract is defined as follows. (Line numbers are included for reference only.)

 

clip_image006

 

Customers report that the transaction completes successfully even if the Update method throws an exception.

 

You need to ensure that the transaction is aborted if the Update method is not successful.

 

What should you do?

 

A.

insert the following line at line 22.

throw;

B.

Insert the following line at line 09.

[ServiceBehavior(

TransactionAutoCompleteOnSessionClose = false)]

C.

Replace line 12 with the following line.

[OperationBehavior(

TransactionScopeRequired = true,

TransactionAutoCoroplete – false)]

D.

Insert the following line at line 09.

[ServiceBehavior(

TransactionAutoCompleteOnSessionClose = true)]

 

Correct Answer: A

 

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

Try Microsoft 70-513 Free Demo