[Actual] 70-513 Microsoft free exam questions 61-75 (Mar 2016)

Question No. 61

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. 

Answer:


Question No. 62

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

Answer:


Question No. 63

You have an existing Windows Communication Foundation (WCF) Web service. 

The Web service is not responding to messages larger than 64 KB. 

You need to ensure that the Web service can accept messages larger than 64 KB without generating errors. 

What should you do? 

A. Increase the value of maxReceivedMessageSize on the endpoint binding. 

B. Increase the value of maxRequestLength on the httpRuntime element. 

C. Increase the value of maxBufferSize on the endpoint binding. 

D. Increase the value of maxBufferPoolSize on the endpoint binding. 

Answer:


Question No. 64

You are creating an ASP NET web application that hosts several Windows Communication Foundation (WCF) services the services have ASP.NET Compatibility Mode enabled. 

Users authenticate with the Web application by using a cookie-based ASR NET Forms Authentication model. You add a service tile named Authentication. svc that contains the following code segment 

<%@ SenviceHost Servicee"System 

Web Application Services Authentication Service”Factory="System.Web.ApplicationServices.AppicationServicesHostFactory’ %>. 

You need to ensure that users can access the WCF services without having to re-authenticate. 

Which two configuration settings should you add? (Each is part of a complete solution. Choose two.) 

A. In the system web.extensions/scripting/webServices/authenticationService element, set the enabled attribute to true. 

B. In the system web.extensions/scripting/webServices/profileService element, set the enabled attribute to true. 

C. Add a service endpoint with basicHttpBinding for the contract System.WebApplicationServices.AuthenticationService. 

D. Add a custom service behavior named AuthenticationServiceTypeBehaviors with a serviceAuthenticationManager element that has serviceAuthenticationManagerType set to System Web Security. SQL Membership Provider 

Answer: AC 


Question No. 65

You are developing a Windows Communication Foundation (WCF) service that contains the following service contract. 


You need to ensure that RecordPayments can correctly deserialize into an Employee or a Customer object. 

What should you do? 

A. Implement the IExtensibleDataObject interface in the Person class. 

B. Add the following KnownType attribute to the Employee class and to the Customer class. [KnownType(typeof(Person))] 

C. Implement the IExtension<> interface in the Person class. 

D. Add the following KnownType attributes to the Person class. [KnownType(typeof(Employee))] [KnownType(typeof(Customer))] 

Answer:


Question No. 66

You are implementing a Windows Communication Foundation (WCF) service contract named IContosoService in a class named ContosoService. The service occasionally fails due to an exception being thrown at the service. 

You need to send the stack trace of any unhandled exceptions to clients as a fault message. 

What should you do? 

A. In the application configuration file on the client, add the following XML segment to the 

system.serviceModel/behaviors configuration section group. 

<endpointBehaviors> 

<behavior name=" debug "> 

< callback Debug includeExceptionDetailInFaults="true" /> 

</behavior> 

</endpointBehaviors> 

Associate the debug behavior with any endpoints that need to return exception details. 

B. In the application configuration file on the service and all the clients, add the following 

XML segment to the system.diagnostics/sources configuration section group. 

<source name="System.ServiceModel" switchValue="Error" propagateActivity="true"> 

<listeners> 

<add name="ServiceModelTraceListener" 

initializeData="app_tracelog.svclog" 

type="System.Diagnostics.XmlWriterTraceListener" /> 

</listeners> 

</source> 

C. Apply the following attribute to the ContosoService class. 

[ServiceBehavior(IncludeExceptionDetailInFaults = true)] 

D. For each OperationContract exposed by IContosoService, apply the following attribute. 

[FaultContract(typeof(Exception))] 

Answer:


Question No. 67

You create a Windows Communication Foundation (WCF) service. 

The service must meet the following requirements: . Communicate errors as exceptions that originate in the service operations. . Publish the errors as part of the WCF contract. 

You need to throw an exception inside the service operation method. 

Which type of exception should you throw? 

A. ProtocolException 

B. FaultException 

C. PoisionMessageException 

D. CommunicationException 

Answer:


Question No. 68

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. 

Answer:


Question No. 69

You develop a Windows Communication Foundation (WCF) service that contains the following code segment. (Line numbers are included for reference only.) 


A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:


Question No. 70

You implement a Windows Communication Foundation (WCF) service. The service is hosted in Internet Information Services (IIS). 

The service must use X.509 certificates to authorize specific methods. 

You need to configure the service. 

What should you do? (Each correct answer presents part of the solution. Choose two.) 

A. Set the value of the Name property of the PrincipalPermissionAttribute to the identity of the certificate. 

B. Set the value of the ControlEvidence property of the SecurityPermissionAttribute to the identity of the certificate. 

C. In the web.config file for the service, in the serviceAuthorization element, set the value of the PrincipalPermissionMode attribute to UseAspNetRoles. 

D. In the web.config file for the service, in the serviceAuthorization element, set the value of the PrincipalPermissionMode attribute to UseWindowsGroups. 

Answer: AC 


Question No. 71

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> 

Sub PostData(Byval data As Order) You need to modify PostData so that it can receive any SOAP message. 

Which code segment should you use? 

A. <OperationContract(lsOneWay True, Action ReplyAction ‘-)> Sub PostData(ByVal data As Order) 

B. OperationContract(lsOneway: zTrue, Action:z’-’, ReplyAction: z"-’)> Sub PostData(ByVal data As BodyWriter) 

C. <OperationContract> Sub PostData(Byval data As BodyWriter) 

D. <OperationContract0> Sub PostData(ByVal data As Message) 

Answer:


Question No. 72

You are developing a Windows Communication Foundation (WCF) service. The following code defines and implements the service. (Line numbers are included for reference only.) 


You need to ensure that two identical copies of the received message are created in the service. 

Which code segment should you insert at line 12? 

A. Message msgCopy = message. 

CreateBufferedCopy(8192) as Message; 

Message returnMsg = message. 

CreateBufferedCopy(8192) as Message; 

B. MessageBuffer buffer = message. 

CreateBufferedCopy(8192); 

Message msgCopy = buffer.CreateMessage(); 

Message returnMsg = buffer.CreateMessage(); 

C. MessageBuffer buffer = message. 

CreateBufferedCopy(8192); 

Message msgCopy = buffer.CreateMessage(); 

Message returnMsg = msgCopy; 

D. Message msgCopy = message; 

Message returnMsg = message; 

Answer:


Question No. 73

You are developing a Windows Communication Foundation (WCF) client application. 

You instantiate a client class that inherits from ClientBase. The client instance must always be shut down in such a way that tt can free up any resources it is referencing. You need to ensure that all exceptions are caught and the instance is always properly shut down. 

Which code segment should you use? 


A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:


Question No. 74

You are creating a Windows Communication Foundation (WCF) service that is implemented as follows. 

(Line numbers are included for reference only.) 

01|ServiceContract] 

02[ServiceBehavior (includeExceptionDetàilslnFaults = true) 1 

03putiic class OrderService 

04{ 

05[Operation Contract] 

06putiic void Submit Order (Order an Order) 

07{ 

O8try 

09{ 

10... 

11) 

12catch (DivideByZeroExcepton ex) 

13{ 

15) 

16) 

17) 

You need to ensure that the stack trace details of the exception are not included in the error information sent to the client. 

What should you do? 

A. Replace line 14 with the following line. Throw: 

B. Replace line 14 with the following line throw new FaultException<Order>(anOrder, ex.ToString(fl; 

C. After hne 05, add the following line. [FaultContract(typeof(FaukEception<Order>))J Replace line 14 with the following line throw ex; 

D. Alter hne 05, add the following line [FaultContract(typeof(FaultException<Order>))J Replace line 14 with the following line. Throw new FaultException<Order>(anOrder, "Divide by zero exception”): 

Answer:


Question No. 75

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 > 

Answer: