Home » [Free] Get all latest Microsoft 70-513 Actual Tests 41-50

[Free] Get all latest Microsoft 70-513 Actual Tests 41-50

Ensurepass

QUESTION 41

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.)

 

01 <ServiceContract()>

 

02 Public Interface IDatallpdate

 

03

 

04 <OperationContract()>

 

05 <TransactionFlow(TransactionFlowOption.Handatocy)>

 

06 Sub Update (ByVal accountNumber As String,

 

ByVal amount As Double)

 

07

 

08 End Interface

 

09

 

10 Class UpdateService

 

11 Implements IDataUpdate

 

12

 

13 <OperationBehavior(

 

TransactionScopeRequired:=True, TransactionAutoComplete:=True)>

 

14 Public Sub Update(ByVal accountNumber As String,

 

ByVal amount As Double)

 

Implements IDataUpdate.Update IS

 

16 Try

 

17

 

18 Catch ex As Exception

 

19 WriteErrorLog(ex)

 

20

 

21 End Try

 

22

 

23 End Sub

 

24

 

25 End Class

 

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 20.

Throw

B.

Replace line 13 with the following line.

<OperationBehavior(

TransactionScopeRequired:MTrue,

TransactionAutoComplece:”False)>

C.

Insert the following line at line 09.

<ServiceBehavlor(

TransactionAutoCoropleteOnSessionClose:”False) >

D.

Insert the following line at line 09.

<ServiceBehavior(

TransacCionAucoCompleteOnSesslonClose:”True) >

 

Correct Answer: A

 

 

QUESTION 42

You are developing a client that sends several types of SOAP messages to a Windows Communication Foundation (WCF) service method named PostData.

 

PostData is currently defined as follows.

 

[OperationContract]

 

void PostData(Order data);

 

You need to modify PostData so that it can receive any SOAP message.

 

Which code segment should you use?

 

A.

[OperationContract(IsOneWay = true, Action = “*”, ReplyAction = “*”)]

void PostData(Order data);

B.

[OperationContract(IsOneWay = true, Action = “*”, ReplyAction = “*”)]

void PostData(BodyWriter data);

C.

[OperationContract]

void PostData(BodyWriter data);

D.

[OperationContract]

void PostData(Message data);

 

Correct Answer: D

 

 

QUESTION 43

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

 

[ServiceContract(Namespace=”http://contoso.com”)] public interface IShipping

 

{

 

[OperationContract] string DoWork(int id);

 

}

 

This is one of several service contracts hosted by your application. All endpoints use SOAP 1.2 bindings with WS-Addressing 1.0. The System.ServiceModel.MessageLogging trace source in the system.diagnostics configuration section is configured with one listener.

 

You need to make sure that only the messages that are returned from the DoWork operation are logged.

 

Which XML segment should you add to the system.serviceModel/diagnostics/messageLogging/filters configuration element?

 

A.

<add xmlns:addr=”http://www.w3.org/2005/08/addressing”> //addr:Action[text() = ‘http://contoso.com/IShipping/DoWorkResponse’]

</add>

B.

<add xmlns:soap=”http://www.w3.org/2003/05/soap-envelope”> //soap:Action[text() = ‘http://contoso.com/IShipping/DoWorkResponse’]

</add>

C.

<add xmlns:addr=”http://www.w3.org/2005/08/addressing”> //addr:Action[text() = ‘http://contoso.com/IShipping/DoWork’]

</add>

D.

<add xmlns:soap=”http://www.w3.org/2003/05/soap-envelope”> //soap:Action[text() = ‘http://contoso.com/IShipping/DoWork’]

</add>

 

Correct Answer: A

 

 

QUESTION 44

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 verify 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.ServiceModel trace source in the system.diagnostics configuration section. In the system.serviceModel configuration, add the following XML segment.

<diagnostics>

<messageLogging

logEntireMessage=”true”

logMessagesAtServiceLevel=”true”

logMessagesAtTransportLevel=”true” />

</diagnostics>

B.

Configure the System.ServiceModel trace source in the system.diagnostics configuration section. In the system.serviceModel configuration, add the following XML segment.

<diagnostics>

<messageLogging

logEntireMessage=”true”

logMessagesAtServiceLevel=”true” />

</diagnostics>

C.

Configure the System.ServiceModel.MessageLogging trace source in the system.diagnostics configuration section. In the system.serviceModel configuration, add the following XML segment.

<diagnostics>

<messageLogging

logEntireMessage=”true”

logMessagesAtServiceLevel=”true”

logMessagesAtTransportLevel=”true” />

</diagnostics>

D.

Configure the System.ServiceModel.MessageLogging trace source in the system.diagnostics configuration section. In the system.serviceModel configuration, add the following XML segment.

<diagnostics>

<messageLogging

logMessagesAtServiceLevel=”true”

logMessagesAtTransportLevel=”true” />

</diagnostics>

 

Correct Answer: C

 

 

 

QUESTION 45

A class named TestService implements the following interface.

 

[ServiceContract]

 

public interface lTestService {

 

[OperationContract]

 

DateTime GetServiceTime;

 

}

 

TestService is hosted in an ASP.NET application.

 

You need to modify the application to allow the GetServiceTime method to return the data formatted as JSON.

 

It must do this only when the request URL ends in /ServiceTime.

 

What should you do?

 

A.

Add this attribute to the GetServiceTime method.

[Weblnvoke(MetMode”POST”)]

In the web.config file, add this element to

system.serviceModel/behaviors/endpointBehaviors.

<behavior namee”Json”>

<enableWebScript />

</behavior>

In the web.config file, configure TestService in the system.serviceModel/services collection as follows:

<service namez”TestService”>

<endpoint address”/ServiceTime”

contracts”TestService”

behaviorConfiguration=”Json”

bindingz”webHttpBinding” />

</service>

B.

Add this attribute to the GetServiceTime method.

[WebInvoke(Method = “GET’,

UriTemplate “/ServiceTime”,

ResponseFormat = WebMessageFormat.Json)]

In the web.config file, configure TestService in the system.serviceModel/services collection as follows:

<service namez”TestService”>

<endpoint address=”/ServiceTime”

contract=”TestService”

bindinge”webHttpBinding” />

</service>

C.

Add this attribute to the GetServiceTime method

[WebGet(

ResponseFormat= WebMessageFormat.Json,

UriTemplatee=”/ServiceTime”)]

Create a new svc file named JsonVersion.svc with the following content.

<%@ ServiceHost Service”TestService’

Factorye=”System.ServiceMode.ActivationWebServiceHostFactory” %>

D.

Add this attribute to the GetServiceTime method.

[WebGet(UriTemplate = (Uson)/ServiceTime”)]

Create a new .svc file named Jsonversion svc with the following content

<%@ ServiceHost Servicee”TestService”

Factory=”System ServiceModel.ActivationWebServiceHostFactory” %>

 

Correct Answer: C

 

 

QUESTION 46

You are developing a Windows Communication Foundation (WCF) service. The service operation takes a customer number as the only argument and returns information about the customer. The service requires a security token in the header of the message. You need to create a message contract for the service. Which code segment should you use?

 

A.

[ServiceContract]

public interface IService

{

[OperationContract]

CustomerInformation GetCustomerInformation(Header header, int customerNumber);

}

[DataContract]

public class CustomerInformation

{

…….

}

[MessageContract]

public class Header { [MessageHeader] public string SecurityTag;

}

B.

[ServiceContract]

public interface IService

{

[OperationContract]

CustomerInformation GetCustomerInformation(Header header, int customerNumber);

}

[MessageContract]

public class CustomerInformation { } [MessageContract] public class Header { [MessageHeader] public string SecurityTag;

}

C.

[ServiceContract]

public interface IService

{

[OperationContract]

CustomerInformation GetCustomerInformation( CustomerNumber request);

}

[DataContract]

public class CustomerInformation { } [MessageContract] public class CustomerNumber { [MessageHeader]

public string SecurityTag; [MessageBodyMember] public int CustomerNumberElement;

}

D.

[ServiceContract]

public interface IService

{

[OperationContract]

CustomerInformation GetCustomerInformation(

CustomerNumber request);

}

[MessageContract]

public class CustomerInformation

{

……

}

[MessageContract] public class CustomerNumber

{

[MessageHeader]

public string SecurityTag;

[MessageBodyMember]

public int CustomerNumberElement;

}

 

Correct Answer: D

 

 

QUESTION 47

A Windows Communication Foundation (WCF) service that handles corporate accounting must be changed to comply with government regulations of auditing and accountability You need to configure the WCF service to execute under the Windows logged-on identity of the calling application. What should you do?

 

A.

Within the service configuration, add a ServiceAuthorization behavior to the service, and set ImpersonateCallerForAulOperations to true.

B.

Within the service configuration, add a ServiceAuthenticationManager behavior to the service, and set ServiceAuthenticationManagerType to Impersonate.

C.

Within the service configuration, add a serviceSecurityAudit behavior to the service, and set serviceAuthorizationAuditLevel to SuccessOrFailure

D.

Within the service configuration, add a ServiceCredentials behavior to the service, and set type to Impersonate

 

Correct Answer: A

 

 

QUESTION 48

A Windows Communication Foundation (WCF) service has a callback contract. You are developing a client application that will call this service. You must ensure that the client application can interact with the WCF service. What should you do?

 

A.

On the OperationContractAttribute, set the AsyncPattern property value to True.

B.

On the OperationContractAttribute, set the ReplyAction property value to the endpoint address of the client.

C.

On the client, create a proxy derived from DuplexClientBase(Of TChannel).

D.

On the client, use GetCallbackChannel (Of T).

 

Correct Answer: C

 

 

 

 

 

 

QUESTION 49

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 <serviceHostingEnvironmentmultipleSiteBindingsEnabled=”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 50

The endpoint of a Windows Communication Foundation (WCF) service uses basicHttpBinding for its binding Your Company’s policies have changed to require that messages not be sent in clear text. You must ensure that all messages are encrypted when traveling across the network. What should you do?

 

A.

Set the ProtectionLevelAttribute on the service contract and update the binding attribute in the endpoint element of the configuration file to wsHttpBinding

B.

Set the ProtectionLevelAttribute on the service contract and update the bindingConfiguration attribute in the endpoint element of the configuration file to webHttpBinding

C.

Set the PrincipalPermissionAttribute on the service contract and update the binding attribute in the endpoint element of the configuration file to wsHttpBinding

D.

Set the PrincipalPermissionAttribute on the service contract and update the bindingConfiguration attribute in the endpoint element of the configuration file to wsHttpBinding.

 

Correct Answer: A

 

Instant Access to Download Testing Software & PDF File for Microsoft 70-513 Real Exam

Instant Access to Try Microsoft 70-513 Free Demo

HOT EXAM!

Name of author

Name: admin