Ensurepass

QUESTION 261

You are developing a Windows Communication Foundation (WCF) REST service to provide access to a library book catalog. The following code segment defines the service contract. (Line numbers are included for reference only.)

 

clip_image001

 

Library patrons want the ability to search the catalog by title.

 

You need to ensure that the GetBookByTitle method is exposed as a service method.

 

Which code segment should you insert at line 04?

 

A.

<WebGet(UriTemplate:=”Book/{title}”)>

B.

<WebGet(UriTemplate:=”BookByTitle/{title)”)>

C.

<WebGet(UciTemplate:-“Book/{titleToSeacch)”)>

D.

<WebGet(UriTemplate:-“{titleToSearch}”)>

 

Correct Answer: B

 

 

QUESTION 262

Your Windows Communication Foundation (WCF) client application uses HTTP to communicate with the service. You need to enable message logging and include all security information such as tokens and nonces in logged messages. What should you do?

 

A.

In the application configuration file, add the logKnownPii attribute to the message logging diagnostics source and set the value of the attribute to true.

Generate the ContosoService class using the Add Service Reference wizard.

Add a reference to System.ServiceModel.Routing.dll.

Add the following code segment.

Dim client As ContosoService = New ContosoService()

Dim behavior As SoapProcessingBehavior = New SoapProcessingBe

havior() behavior.ProcessMessages = True

client.Endpoint.Behaviors.Add(behavior)

B.

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

<diagnostics>

<messageLogging logMessagesAtTransportLevel=”true” logEntireMessage=”true” />

</diagnostics>

C.

In the machine configuration file, add the following XML segment to the system.serviceModel configuration section.

<machineSettings enableLoggingKnownPii=”true” />

Generate the ContosoService class using the Add Service Reference wizard.

Add the following code segment:

Dim client As ContosoService = New ContosoService() client.Endpoint.Behaviors.Add(New CallbackDebugBehavior(True))

D.

In the machine configuration file, add the following XML segment to the system.serviceModel configuration section.

<machineSettings enableLoggingKnownPii=”true” />

In the application configuration file, add the logKnownPii attribute to the message logging diagnostics source and set the value of the attribute to true.

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

<diagnostics>

<messageLogging logMessagesAtTransportLevel=”true”/>

</diagnostics>

 

Correct Answer: D

 

 

QUESTION 263

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

 

A.

< serviceHostingEnvironment >

< serviceActivations >

<add relativeAddress =” Info.svc ” service=”Info” />

</ serviceActivations >

</ serviceHostingEnvironment >

B.

< serviceHostingEnvironment >

< serviceActivations >

<add relativeAddress =”Info” service=” Info.svc ” />

</ serviceActivations >

</ serviceHostingEnvironment >

C.

< serviceHostingEnvironment >

< transportConfigurationTypes >

<add name=”Info” transportConfigurationType =” Info.svc ” />

</ transportConfigurationTypes >

</ serviceHostingEnvironment >

D.

< serviceHostingEnvironment >

< transportConfigurationTypes >

<add name=” Info.svc ” transportConfigurationType =” FileNotRequired ” />

</ transportConfigurationTypes >

</ serviceHostingEnvironment >

 

Correct Answer: A

 

 

QUESTION 264

You create a Windows Communication Foundation (WCF) sen/ice. It is deployed on Microsoft Internet Information Services (IIS) with an application pool running as Network Service. You enable WMI tracing before launching the service. Your IT support staff adds WMI data collection through ASP.NET WMI tracing. You need to restrict the collection of WMI data to a privileged account. What should you do in WMI Control in the Computer Management console?

 

A.

Select the Root\aspnet namespace.

Remove Enable account permission for the Network Service account.

Add a custom user and grant that user Enable account permission.

B.

Select the Root\aspnet namespace.

Remove Enable account permission for the Local System account.

Add a custom user and grant that user Enable account permission.

C.

Select the Root\Security namespace.

Remove Enable account permission for the Local System account.

D.

Select the Root\ServiceModel namespace.

Remove Enable account permission for the Network Service account.

Add a custom user and grant that user Enable account permission.

 

Correct Answer: D

 

 

QUESTION 265

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 266

You are developing a Windows Communication Foundation (WCF) service that executes a long-running operation. The service is accessed from your business applications in a server transaction in which the client does not participate. You need to ensure that the transaction times out and aborts if the operation has not completed within 45 seconds. What should you do?

 

A.

Set the service binding sendTimeout attribute to 00:00:45.

B.

Apply f ServiceBehavior (TransaccionTlmeout=”00:00:45″)] to the service implementation.

C.

Set the service binding receiveTimeout attribute to 00:00:45.

D.

Apply [OperationBehavior (TransaccionScopeRequired=false)] to the service operation.

 

Correct Answer: B

 

 

 

QUESTION 267

You are developing a new version of an existing message contract named CustomerDetailsVersion1. The new version of the message contract must add a Department field of type String to the SOAP header. You create a new class named GustomerDetailsVersion2 that inherits from CustomerDetailsVersion1. You need to ensure that all client applications can consume the service. Which code segment should you use?

 

A.

[MessageContract]

public class CustomerDetailsVersion2 : CustomerDetailsVersion1 {

[MessageHeader(MustUnderstand = true)]

public string Department;

}

B.

[MessageContract]

public class CustomerDetailsVersion2 : CustomerDetailsVersion1 {

[MessageHeader(MustUnderstand = false)]

public string Department;

}

C.

public class CustomerDetailsVersion2 : CustomerDetailsVersion1 {

[MessageHeader(MustUnderstand = true)]

public string Department;

}

D.

public class CustomerDetailsVersion2 : CustomerDetailsVersion1 {

[ MessageHeader( MustUnderstand = false ) ]

public string Department;

}

 

Correct Answer: B

 

 

QUESTION 268

You create a Windows Communication Foundation (WCF) service. It is deployed on Microsoft Internet Information Services (IIS) with an application pool running as Network Service. You enable WMI tracing before launching the service. Your IT support staff adds WMI data collection through ASP.NET WMI tracing. You need to restrict the collection of WMI data to a privileged account. What should you do in WMI Control in the Computer Management console?

 

A.

Select the Root\ServiceModel namespace.

Remove Enable account permission for the Network Service account.

Add a custom user and grant that user Enable account permission.

B.

Select the Root\aspnet namespace.

Remove Enable account permission for the Network Service account.

Add a custom user and grant that user Enable account permission.

C.

Select the Root\aspnet namespace.

Remove Enable account permission for the Local System account.

Add a custom user and grant that user Enable account permission.

D.

Select the Root\Security namespace.

Remove Enable account permission for the Local System account.

 

Correct Answer: A

Explanation:

http://msdn.microsoft.com/en-us/library/ms735120.aspx

 

 

 

 

QUESTION 269

You are creating a Windows Communication Foundation (WCF) service.

 

You have the following requirements:

 

clip_image003Messages must be sent over TCP.

clip_image003[1]The service must support transactions.

clip_image003[2]Messages must be encoded using a binary encoding.

clip_image003[3]Messages must be secured using Windows stream-based security.

 

You need to implement a custom binding for the service.

 

In which order should the binding stack be configured?

 

A.

tcpTransport

windowsStreamSecurity

transactionFlow

binaryMessageEncoding

B.

transactionFlow

binaryMessageEncoding

windowsStreamSecurity

tcpTransport

C.

windowsStreamSecurity

tcpTransport

binaryMessageEncoding

transactionFlow

D.

binaryMessageEncoding

transactionFlow

tcpTransport

windowsStreamSecurity

 

Correct Answer: B

 

 

QUESTION 270

You develop a Windows Communication Foundation (WCF) service to generate reports. Client applications call the service to initiate report generation but do not wait for the reports to be generated. The service does not provide any status to the client applications.

 

The service class is defined as follows. (Line numbers are included for reference only.)

 

01 <ServiceContract()>

 

02 Public Class ReportGeneratorService

 

03

 

04 Private Function GenerateReports(

 

ByVal clientID As Integer) As Integer

 

05 &

 

06 Return 0

 

07 End Function

 

08

 

09 End Class

 

You need to ensure that client applications can initiate reports without waiting for status.

 

Which two actions should you perform (Each correct answer presents part of the solution. Choose two.)

 

A.

Insert the following code at line 03.

<OperationContract(IsOneWay:=True)>

B.

Insert the following code at line 03.

<OperationContract(AsyncPattern:=False)>

C.

At line 04, change the GenerateReports method from Private to Public.

D.

Remove line 06. At line 04, change the type of GenerateReports method to Sub.

Remove the code As Integer from the method definition.

 

Correct Answer: AD

 

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

Try Microsoft 70-513 Free Demo