Ensurepass

QUESTION 111

You are creating a Windows Communication Foundation (WCF) service that uses claims- based authorization. The following code retrieves the correct claim set.

 

var claims = ServiceSecurityContext.Current.

 

AuthorizationContext.ClaimSets[0];

 

You need to validate that the requesting client application has included a valid DNS value in the claim.

 

Which code segment should you use to retrieve the claim for validation?

 

A.

claims.FindClaims(ClaimTypes.Dns, Rights.PossessProperty) .FirstOrDefault();

B.

claims.FindClaims(ClaimTypes.Dns, Rights.Identity) .FirstOrDefault();

C.

claims.ContainsClairo(Claim.CreateDnsClaim(ClaimTypes.Dns));

D.

claims.Equals(ClaimTypes.Dns);

 

Correct Answer: A

Explanation:

ClaimSet can has only one Rights.Identity claim. It contains user identity information. All additional data, like DNS, stored in claims with PossessProperty rights

 

 

QUESTION 112

Your company has a Windows Communication Foundation (WCF) service at the URL http://services.contoso.com/OrderLookupService.svc.

 

The <system.serviceModel> section of the configuration file is as follows. (Line numbers are included for reference only.)

 

01 <system.serviceModel>

 

02

 

<behaviors>

 

03 <serviceBehaviors>

 

04 <behavior>

 

05 <serviceDebug

 

includeExceptionDetailInFaults=”false”/>

 

06

 

07 </behavior>

 

08 </serviceBehaviors>

 

09 </behaviors>

 

10 <serviceHostingEnvironment

 

multipleSiteBindingsEnabled=”true” />

 

11 </system.serviceModel>

 

You need to ensure that the service publishes the WSDL description at

 

http://services.contoso.com/OrderLookupService.svc?wsdl.

 

What should you do?

 

A.

Change the serviceDebug element at line 05 as follows:

<serviceDebug includeExceptionDetailInFaults=”true”/>

B.

Insert the following element at line 06.

<serviceDiscovery>

< announcementEndpoints>

<endpoint name=”wsdlAnnouncement” kind=”udpAnnouncementEndpoint” />

</announcementEndpoints>

</serviceDiscovery>

C.

Insert the following element at line 06.

<serviceMetadata httpGetEnabled=”true” />

D.

Insert the following element at line 06.

<serviceMetadata httpGetEnabled=”false” />

 

Correct Answer: C

 

 

QUESTION 113

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/javaScript” src=”/Services/Contoso.svc/js” />

 

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

 

What should you do?

 

A.

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

B.

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

C.

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

D.

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

 

Correct Answer: C

 

 

QUESTION 114

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 code? (To answer, drag the appropriate code segment to the correct location in the answer area. Each code 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_image002

 

Correct Answer:

clip_image004

 

 

QUESTION 115

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

 

clip_image005

 

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

 

clip_image006

 

Which code segment should you use?

 

A.

<DataMember()>

Public firstName As String

<DataMember()>

Public lastName As String

<DataMember(EmitDefaultValue:=True)>

Public age As Integer = 0

<DataMember(EmitDefaultValue:=True)>

Public ID As Integer = 999999999

B.

<DataMember(EmitDefaultValue:=False)>

Public firstName As String = Nothing

<DataMember(EmitDefaultValue:=False)>

Public lastName As String = Nothing

<DataMember(EmitDefaultValue:=True)>

Public age As Integer = -1

<DataMember(EmitDefaultValue:=False)>

Public ID As Integer = 999999999

C.

<DataMember(EmitDefaultValue:=True)>

Public firstName As String

<DataMember(EmitDefaultValue:=True)>

Public lastName As String

<DataMember

(EmitDefaultValue:=False)>

Public age As Integer = -1

<DataMember(EmitDefaultValue:=False)>

Public ID As Integer = 999999999

D.

<DataMember()>

Public firstName As String = Nothing

<DataMember()>

Public lastName As String = Nothing

<DataMember(EmitDefaultValue:=False)>

Public age As Integer = 0

< DataMember(EmitDefaultValue:=False)>

Public ID As Integer = 999999999

 

Correct Answer: D

 

 

QUESTION 116

You develop a Windows Communication Foundation (WCF) service that uses basic authentication for client credentials. This service is currently configured to use message security. The service is hosted on a server in workgroup mode. Users report that their passwords are stolen when they use public computers. You need to ensure that messages are secure and users are authenticated. You prevent the service from being called over HTTP through Microsoft Internet Information Services (IIS) configuration. What should you do next?

 

A.

Use the transport security mode and specify None for transport client credential type.

B.

Use the transportWithMessageCredential security mode and specify Basic for the transport client credential type.

C.

Use the message security mode and specify Basic for the transport client credential type.

D.

Use the transportWithMessageCredential security mode and specify None for the transport client credential type.

 

Correct Answer: B

 

 

QUESTION 117

A Windows Communication Foundation (WCF) service is deployed with netTcpBinding. This service uses a duplex message exchange pattern. You are developing the next version of the WCF service. You discover that your company’s hardware load balancer performs correctly only for WCF services that use HTTP. You need to ensure that your service works with the load balancer. What should you do?

 

A.

Create a custom binding that has the compositeDuplex. textMessageEncoding, and wsHttpTransport binding elements in this order.

B.

Use basicHttpBinding.

C.

Create a custom binding that has the compositeDuplex, textMessageEncoding, and namedPipeTransport binding elements in this order.

D.

Use wsHttpBinding.

 

Correct Answer: A

 

 

QUESTION 118

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 119

You are modifying a Windows Communication Foundation (WCF) service that issues security tokens. The service is accessible through the named pipe protocol. No endpoints are added in the service code. The configuration file for the service is as follows. (Line numbers are included for reference only.)

 

clip_image008

 

You need to ensure that new and existing client applications can access the service through HTTP and named pipes.

 

What should you do?

 

A.

Insert the following line at line 05.

<endpoint address=http://www.contoso.com

binding=”wsHttpBinding”

contract=”Contoso.TokenService” />

B.

Insert the following line at line 05.

<endpoint address=”http://www.contoso.com”

binding=”basicHttpBinding”

contract=”Contoso.TokenService” />

C.

Insert the following line at line 08.

<add baseAddress=”http://www.contoso.com” />

D.

Insert the following line at line 08.

< add baseAddress=”net.tcp://www.contoso.com:8090″ />

 

Correct Answer: C

 

 

 

QUESTION 120

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

 

<ServiceContract(SessionMode:=SessionMode Allowed)s

 

Public Interface lMyService <OperationContract(lsTerminating:sFalse)s

 

Sub Initialize ()

 

<OperationContract(lslnitiating:sFalse)>s

 

Sub DoSomething()

 

<OperationContract(lsterminating:=True)>

 

Sub Terminate ()

 

End Interface You need to change this interface so that:

 

“Initialize is allowed to be called at any time before Terminate is called.

 

“DoSomething is allowed to be called only after Initialize is called, and not allowed to be called after Terminate is called. “Terminate will be allowed to be called only after Initialize is called

 

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

 

A.

Change the ServiceContract attribute of the lMyService interface to the following:

ServiceContract(SessionMode:sSessionMode. Required)

B.

Change the ServiceContract attribute of the lMyService interface to the following:

ServiceContract(SessionMode:sSessionModeAllowed)

C.

Change the OperationContract attribute of the Initialize operation to the following:

OperationContract(lslnitiating: `True, IsTerminating: `False)

D.

Change the OperationContract attribute of the Terminate operation to the following:

OperationContract(Islnitiatings:False, lsTerminating: `True)

 

Correct Answer: AD

 

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

Try Microsoft 70-513 Free Demo