Ensurepass

QUESTION 21

You are creating a windows Communication Foundation (WCF) service to process orders.

 

The data contract for the order is defined as follows:

 

[DataContract]

 

public class Order

 

{

 

 

[DataMemberl

 

public string CardHolderName { get; set;

 

[DataMember]

 

public string CreditCardNumber { get; set; }

 

}

 

You have the following requirements

 

clip_image002Enable the transmission of the contents of Order from the clients to the service.

clip_image002[1]Ensure that the contents of CreditCardNumber are not sent across the network in clear text.

clip_image002[2]Ensure that the contents of CreditCardNumber are accessible by the service to process the order.

 

You need to implement the service to meet these requirements.

 

What should you do?

 

A.

Add a DataProtectionPermission attribute to the CreditCardNumber property and set the ProtectData property to true.

B.

Convert the DataContract to a MessageContract and set the ProtectionLevel property to SignAndEncrypt.

C.

Change the data type of CreditCardNumber from string to SecureString.

D.

Implement the CreditCardNumber property getter and setter. In the setter, run the value of the CreditCardNumber through the MD5CryptoServiceProvider class TransformBlock method.

 

Correct Answer: B

 

 

QUESTION 22

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 23

DRAG DROP

You develop a Windows Communication Foundation (WCF) service that is hosted within a console application. The service implements the IRegistrationService interface in a class named RegistrationService. The service uses the following endpoint URL:

 

http://localhost:8080/registrationservice/basic

 

You need to configure the console application to host the service.

 

How should you complete the relevant markup? (To answer, drag the appropriate markup segment to the correct location in the answer area. Each segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)

 

clip_image004

 

Correct Answer:

clip_image006

 

 

 

 

QUESTION 24

You create a service and deploy it on a network in a building named Building1. You will deploy the service to Building2.

 

The service in Building1 is configured using the following discovery scopes.

 

<scopes>

 

<add

 

scope=”http://contoso.com/Chicago/Building1″/>

 

<add

 

scope=”ldap:///ou=Building1,ou=Chicago,o=contoso,c=us”/>

 

</scopes>

 

The service in Building2 will be configured using the following discovery scopes.

 

<scopes>

 

<add

 

scope=”http://contoso.com/Chicago/Building2″/>

 

<add

 

scope=”ldap:///ou=Building2,ou=Chicago,o=contoso,c=us”/>

 

</scopes>

 

You need to ensure that the client application can discover the service in Building1 or the service in Building2.

 

Which scopes should you add to the client configuration file?

 

A.

<scopes>

<add scope=”http://contoso.com/Chicago/*”/>

</scopes>

B.

<scopes>

<add scope=”http://contoso.com/Chicago”/>

</scopes>

C.

<scopes>

<add

scope=”ldap:///ou=Building,ou=Chicago,o=contoso,c=us”/>

</scopes>

D.

<scopes>

<add

scope=”ldap:///ou=*,o=contoso,c=us”/>

</scopes>

 

Correct Answer: B

 

 

QUESTION 25

A Windows Communication Foundation (WCF) service only accepts messages that are signed and encrypted a client application is not receiving expected responses from the service. You need to enable logging to verity that the messages from the client are signed and encrypted. You also need to see what each message looks like before the message body is deserialized into a NET object what should you do?

 

A.

Configure the System Service Model trace source in the system diagnostics configuration section.

In the system service Model configuration add the following xML segment

<diagnostics>

<message Logging log Entire Messages” true

logMessagesAtServiceLeveIetrue”

logMessagesAtTransportLeveletrue” />

</diagnostics>

B.

Configure the System. Service Model trace source in the system diagnostics configuration section.

In the system.serviceModel configuration, add the following XML segment,

<diagnostics>

<message Logging log Entire Message=”

true log Messages t Service LeveI-true’ Is

<diagnostics>

C.

Configure the System. Service Model Message Logging trace source in the system diagnostics configuration sectionIn the system. service Model configuration, add the following XML segment.

<diagnostics>

<message Logging log Entire Message=’

true Iog Messages At Service LeveI true”

log Messages At Transport Level=true” I>

<Idiagnostics>

D.

Configure the System. Service Model Message Logging trace source in the system diagnostics configuration section.

In the system service Model configuration, add the following xML segment

<diagnostics>

<message Logging Iog Messages At Service Levele true”

log Messages At Transport Levele”true” 1>

</diagnostics>

 

Correct Answer: C

 

 

QUESTION 26

You are modifying a Windows Communication Foundation (WCF) service that allows customers to update financial data. The service currently requires a transaction from the client application and is working correctly. The service contract is defined as follows. (Line numbers are included for reference only.)

 

clip_image007

 

The service must be modified so that client applications do not need to initiate a transaction when calling the operation. The service must use the client application’s transaction if one is available. Otherwise it must use its own transaction. You need to ensure that the service operation is always executed within a transaction. What should you do?

 

A.

Replace line 05 with the following code.

<TransactionFlow(

TransactionFlowOption.NotAliowed)>

B.

Replace line 13 with the following code.

<OperationBehavior(

TransactionScopeRequired:”False,

TransactionAutoComplete:-True)>

C.

Replace line 05 with the following code.

<TransactionFlow(

TransactionFlowOption.Allowed) >

D.

Replace line 13 with the following code.

<OperatlonBehavior(

TransaetionScopeRequired:”False,

TransactionAutoComplete:”False)>

 

Correct Answer: B

 

QUESTION 27

You are developing a Windows Communication Foundation (WCF) service. You enable message logging, trace listeners, activity propagation, and tracing on the trace sources.

 

You have the following code segment in the client application. (Line numbers are included for reference only.)

 

clip_image008

 

You encounter errors when your client application consumes the service.

 

You need to ensure that your client application can correlate tracing information with the service.

 

Which code segment should you add at line 04?

 

clip_image010

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: C

 

 

QUESTION 28

A Windows Communication Foundation (WCF) service implements the following cortract.

 

<ServiceContract0>?

 

Public Interface lHeloServic e <operationContractQ>

 

<WebGet(UriTempbte: =”helloname={name}”)s

 

Function SayHello(Byval name As String) As nng End Interface

 

The implementation is as follows

 

Public Class HelloService

 

Implements IHelloService

 

Public Function SayHello(ByVal name As String) As String – Implements lHelloServiceSayHello

 

Retumn “Hello “& name

 

End Function

 

End Cesst

 

The service is self-hosted, and the hosting code is as follows.

 

Dim stHost As WebServiceHo = CreateHost()

 

svcHo Open()

 

Consde ReadLine()

 

svcHoaClose()

 

You need to implement CreateHost so that the service has a single endpoint hosted

 

http:/Ilocalhost8000/HeloService.

 

Which code segment should you use?

 

A.

Dim svc Host As WebSennceHost = New WebServiceHost(GetType(HdloService))

svc HotsAddServiceEndpoint(GdType(lHelloService),

New WebHttpBinding(WebHttpSecurityModeNone),

“http:/Ibc alhost 8000!HelloService”)

Return svc Host

B.

Dim baseAddress As Ur New Uri(“http:/i1ocahost:8000r) Dim svcHo As WebServiceHost =

New WebServiceHost(GetType(HelloService), baseAddress)

svc Host.AddServiceEndpoint(GdType(lHelloService),?

New Web Http Binding (WebHttpSec urityMode None),

HelloService)

Return svc Host

C.

Dim svc Host As WebServiceHost = New WebServiceHost(New HelloSennceO)

svcHost.AddServiceEndpoint(GetType(IHelloService),

New WebHttpBinding(WebHttpSecurityModeNone),

Thttp://bc aihost: 8000/HelloSennce”)

Return svc Host

D.

Dim baseAddress As Ur = New Uri(“http/I1ocahost 8OOOP Dim svcHo As

WebServiceHost = New

WebServiceHost(New HelloService0, baseAddress)

svc HostAddServiceEndpoint(GdType(IHelIoService),

New WebHttpBinding(WebHttpSecuntyMode None),

“HelloService”)

Return svc Host

 

Correct Answer: B

 

 

QUESTION 29

You are developing a Windows Communication Foundation (WCF) service that returns location information for authorized law enforcement agencies. The service contract is as follows.

 

[ServiceContract]

 

public interface IMappingService

 

{

 

[OperationContract]

 

long[] GetLocationCoordinates(String cityNaroe);

 

[OperationContract]

 

long[] GetLocationOfCitizen(String ssn) ;

 

}

 

Users are authenticated and impersonated. The system uses ASP.NET roles. The members of law enforcement are members of the LawEnforcement role.

 

You need to ensure that only members of the LawEnforcement role can call these methods.

 

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

 

A.

Add a PrincipalPermissionAttribute to each method that should be available only to members of law enforcement. Set its SecurityAction to Demand and set the role equal to LawEnforcement.

B.

Use the CurrentPrincipal property of the thread. Call the IsInRole method specifying LawEnforcement as a parameter.

C.

Create a GenericPrincipal specifying Thread.CurrentPrincipal.Identity as the IldentityParameter and LawEnforcement as the only value for the Roles parameter.

D.

At the beginning of each method, enumerate each ClaimSet in a new WindowsClaimSet. Use the FindClaims method to locate a claim type named Role with a right named LawEnforcement.

 

Correct Answer: AB

 

 

 

 

QUESTION 30

You are developing a Windows Communication Foundation (WCF) service. One of the service operations contains the following code.

 

clip_image011

 

You need to set a service behavior that prevents two or more threads from incrementing the counter variable at the same time.

 

Which code segment should you use to set the service behavior?

 

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