Free Download New Updated Microsoft 70-513 Real Exam Questions and Answers 91-100

Ensurepass

QUESTION 91

An ASP.NET application hosts a RESTful Windows Communication Foundation (WCF) service at /Services/Contoso.svc . The service provides a JavaScript resource to clients. You have an explicit reference to the JavaScript in your page markup as follows:

 

<script type=”text/3avaScript” src=”/Secvices/Contoso.svc/js” />

 

You need to retrieve the debug version of the service JavaScript.

 

What should you do?

 

A.

In the <<to@ ServiceHost ?>; header for /Services/Contoso.svc, set the Debug attribute to true.

B.

In the <<H>@ Page <*to> header, set the Debug attribute to true.

C.

In the script tag, add a debug attribute and set its value to true.

D.

In the script tag, append debug to the src attribute.

 

Correct Answer: D

 

 

QUESTION 92

You have a Windows Communication Foundation (WCF) service that uses multiple endpoints. The configuration file for the service contains the following XML markup:

 

<source name=”System.ServiceModer switchValue= “Verbose, ActivityTracing”>

 

One of the service endpoints throws an exception.

 

You need to correlate every call to the service to identify the source of the exception.

 

In the configuration file for the service, what should you do?

 

A.

In the diagnostic section, set the value of the propagateActivity attribute to false.

B.

In the diagnostic section, set the value of the propagateActivity attribute to true.

C.

Change the value of the switchValue attribute to Critical.

D.

Change value of the switchValue attribute to Error.

 

Correct Answer: A

 

 

QUESTION 93

A Windows Communication Foundation (WCF) solution uses the following contract to share a message across its clients. (Line numbers are included for reference only.)

 

01 [ServiceContract]

 

02 public interface ITeamMessageService

 

03 {

 

04 [OperationContract]

 

05 string GetMessage0;

 

06

 

07 [OperationContract]

 

08 void PutMessage(string message);

 

09)

 

The code for the service class is as follows

 

10 public class TeamMessageService: ITeamMessageService

 

11 {

 

12 Guid key = GuicLNewGuidO;

 

13 string message = “Today’s Message”:

 

14 public string GetMessage()

 

15 {

 

16 return stringFormat(“Message:{0} Key:{1}”,

 

message, Key);

 

17

 

18

 

19 public void PutMessage(string message)

 

20 {

 

21 thismessage = message;

 

22 }

 

23)

 

The senvice is self-hosted. The hosting code is as follows.

 

24 ServiceHost host =

 

25 BasicHttpBinding binding =

 

new BasicHttpBinding(BasicHttpSecuntyMode.None):

 

26 host AddServiceEndpoint(

 

HMyApplication lTeamMessageService, binding,

 

“http:/Ilocalhost: 12345w);

 

27 host Open0;)

 

You need to ensure that all clients calling GetMessage will retrieve the same string, even if the message is updated by clients calling PutMessage

 

What should you do?

 

A.

Add the following attribute to the TeamMessageService class, before line 10.

[ServiceBehavior(lnstanceContextMode = lnstanceContextMode. Single)]

B.

Add the following attribute to the TeamMessageService class, before line 10.

[ServiceBehavior(lnstanceContextMode = lnstanceContextModePerSession)]

Then change the binding definition on the service at line 25, and on the client to the following WSHttpBinding binding new

WSHttpBinding(SecurityModeNone);

binding ReliableSession. Enabled true;

C.

Pass a service instance to the instancing code in line 24, as follows:

ServiceHost host = new ServiceHost(new TeamMessageServiceO);

D.

Redefine the message string in line 13, as follows:

static string message = `Today’s Message”:

Then change the implementation of PutMessage in lines 19-22 to the following

public void PutMessage(string message) { TeamMessageServicemessage message, }

 

Correct Answer: A

 

 

QUESTION 94

You are debugging a Windows Communication Foundation (WCF) service. The service uses signed and encrypted messages. You need to configure logging so that you can read the contents of the messages. What should you do?

 

A.

Set maxSizeMessagesToLog to 10

B.

Set logMessageAtServiceLevel to true.

C.

Set maxMessagesToLog to 10.

D.

Set logMessageAtTransportLevel to true.

 

Correct Answer: B

 

 

QUESTION 95

You are creating a Windows Communication Foundation (WCF) service. You need to ensure that the service is compatible with ASP.NET to make use of the session state. Which binding should you use?

 

A.

NetTcp ContextBinding

B.

BasicHttpContextBinding

C.

NetTcp Binding

D.

NetMsmqBinding

 

Correct Answer: B

 

 

 

 

 

 

 

 

 

QUESTION 96

A Windows Communication Foundation (WCF) solution uses the following contracts. (Line numbers are included for reference only.)

 

clip_image002

 

When the client calls GetMessage on the service interface, the service calls GetName on the client callback.

 

In the client, the class NameService implements the callback contract.

 

The client channel is created as follows:

 

clip_image004

 

You need to ensure that the service callback is processed by the instance of NameService.

 

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

 

A.

Change line 25 to the following code segment.

Dim factory As DuplexChannelFactory(Of IGreetingService) =

New DuplexChannelFactory(Of IGreetingService)(

callbackContext, binding, address)

B.

Change line 26 to the following code segment.

Dim greetingService As IGreetingService =

factory.CreateChannel(callbackContext)

C.

Add the following code segment after line 26.

callbackContext.IncomingChannels.Add(

DirectCast(greetingService, IDuplexChannel))

D.

Add the following code segment after line 26.

callbackContext.OutgoingChannels.Add(

DirectCast(greetingService, IDuplexChannel))

 

Correct Answer: AB

 

 

QUESTION 97

You are hosting a Windows Communication Foundation (WCF) service at http://www.contoso.com for a law enforcement agency. The agency adds operations to support sending biometric fingerprint data via non-buffered streaming. The service data is not routed between intermediaries. The WCF binding you are using by default does not support encryption. You need to ensure that fingerprint data is not disclosed when it is passed over the network. What should you do?

 

A.

Use basicHttpBinding with message security to https://www.contoso.com.

B.

Use basicHttpBinding over transport security at https://www.contoso.com.

C.

Use wsHttpBinding over message security at https://www.contoso.com.

D.

Use wsHttpBinding over transport security at http://www.contoso.com.

 

Correct Answer: B

 

 

QUESTION 98

You are modifying a Windows Communication Foundation (WCF) service that provides access to report generation system. The following code segment is part of your service contract. (Line numbers are included for reference only.)

 

clip_image005

 

Client applications are blocked while the service processes reports.

 

You need to ensure that the service methods are asynchronous.

 

What should you do?

 

A.

Insert the following code at line 04.

[OperationContract]

Insert the following code at line 07.

[OperationConcracc(AsyncPactern = true)]

B.

Insert the following code at line 04.

[OperationConcracc(AayncPaccern = true)]

C.

Insert the following code at line 04.

[OperotionConcroct(AsyncPactern = false)

Insert the following code at line 07.

[OperacionConcracc(AsyncPactern = true)]

D.

Insert the following code at line 04.

[OperationContract (AsyncPattern = false)]

 

Correct Answer: B

 

 

QUESTION 99

You create a Windows Communication Foundation (WCF) service. You need to ensure that specific users can enable message logging for the service at runtime. In the configuration file for the service, what should you do?

 

A.

Enable debug compilation.

B.

Enable a shared XMLTraceListener object.

C.

Enable the Windows Management Instrumentation (WMI) provider.

D.

Enable message logging.

 

Correct Answer: A

 

 

QUESTION 100

A Windows Communication Foundation (WCF) solution provides a session-based counter.

 

The service is self-hosted. The hosting code is as follows:

 

Dim host As ServiceHost = New ServiceHost(GetType(CounterService))

 

Dim bnding As NetTcpBinding =

 

New NetTcpBinding(SecurityMode.None)

 

host.AddServiceEndpoint(“MyApplication. ICounterService”,

 

binding, “net.tcp://localhost:23456”)

 

host. Open()

 

This service is currently exposed over TCP, but needs to be exposed to external clients over HTTP.

 

Therefore, a new service endpoint is created with the following code.

 

host.AddServiceEndpoint(”MyApplication. lCounterService”,

 

binding2, “http:/!localhost:12345′

 

You need to complete the implementation and ensure that the session-based counter will perform over HTTP as it does over TCP.

 

What should you do?

 

A.

Define binding2 as follows.

Dim binding2 As WS2007HttpBinding =

New WS200lHttpBinding(SecurityMode. None) Configure binding2 as follows.

binding2.ReliableSession.Enabled = True

B.

Define binding2 as follows.

Dim binding2 As WSHttpBinding = — New WSHttpBinding(SecurityMode.None)

Add the following behavior to the service implementation.

<ServceBehavior(lnstanceContextMode:

1nstanceContextMode.PerSession)s

C.

Define binding2 as follows:

Dim binding2 As BasicHttpBinding = New BasicHttpBinding(BasicHttpSecurityMode.None)

Enable cookies for

binding2.

binding2.AllowCookies = True

D.

Define binding2 as follows:

Dim binding2 As BasicHttpBinding = New BasicHttpBinding(BasicHttpSecurityMode. None)

Add the following behavior to the service implementation.

<ServiceBehavior(lnstanceContextMode:

1nstanceContextMode.Single)>

 

Correct Answer: A

 

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

Try Microsoft 70-513 Free Demo