70-513 keys(211 to 225) for IT specialist: May 2021 Edition

Exam Code: 70-513 (Practice Exam Latest Test Questions VCE PDF)
Exam Name: TS: Windows Communication Foundation Development with Microsoft .NET Framework 4
Certification Provider: Microsoft
Free Today! Guaranteed Training- Pass 70-513 Exam.

2021 May 70-513 Study Guide Questions:

Q211. 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 CustomerDetailsVersion2 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 Inherits CustomerDetailsVersionl <MessageHeader(HustUnderstand:=False)> Public Department As String End Class 

B. Public Class CustomerDetailsVersion2 Inherits CustomerDetailsVersionl <MessageHeader(MustUnderstand:=True)> Public Department As String End Class 

C. Public Class CustomerDetailsVersion2 Inherits CustomerDetailsVersionl <MessageHeader(HustUnderstond:"True)> Public Department As String End Class 

D. Public Class CustomerDetailsVersion2 Inherits CustomerDetailsVersionl <MessageHeader(HustUnderstand:=False) > Public Department As String End Class 

E. <MessageContract()> Public Class CustomerDetailsVersion2 Inherits CustomerDetailsVersionl <MessageHeader(HustUnderstand:=True)> Public Department As String End Class 

Answer: A 


Q212. You are developing a Windows Communication Foundation (WCF) service to provide an in-memory cache for many Web applications. The service contract is defined as follows. (Line numbers are included for reference only.) 


You need to ensure that all users share the cache. 

Which code segment should you insert at line 07? 

A. [ServiceBehavior(TransactionlsolationLevel = IsolationLevel.RepeatableRead)] 

B. [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)] 

C. [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession)] 

D. [ServiceBehavior(TransactionlsolationLevel = IsolationLevel.ReadCoromitted)] 

Answer: B 


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

Answer: A 


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

[ServiceContract ] public interface ICustomerService { & } 

public class CustomerService : ICustomerService { & } 

The service is self-hosted in a console application. Older client applications access the service at http://contoso.com:8080/CustomerService/V1. Newer client applications access the service at http://contoso.com:8080/CustomerService/V2. 

You need to ensure that any client application can access the service at either address. 

Which code segment should you use? 

A. Uri serviceAddress1 = 

new Uri("http://contoso.com:8080/CustomerService/V1"); 

Uri serviceAddress2 = 

new Uri("http://contoso.com:8080/CustomerService/V2"); 

ServiceHost host = 

new ServiceHost(typeof(ICustomerService), 

new Uri[] { serviceAddress1, serviceAddress2 }); 

B. Uri serviceAddress1 = 

new Uri("http://contoso.com:8080/CustomerService/V1"); 

Uri serviceAddress2 = 

new Uri("http://contoso.com:8080/CustomerService/V2"); 

ServiceHost host = 

new ServiceHost(typeof(CustomerService), 

new Uri[] { serviceAddress1, serviceAddress2 }); 

C. Uri serviceAddress = 

new Uri("http://contoso.com:8080/"); 

ServiceHost host = 

new ServiceHost(typeof(CustomerService), 

new Uri[] { serviceAddress }); 

host.AddServiceEndpoint(typeof(ICustomerService), 

new BasicHttpBinding(), "CustomerService/V1"); 

host.AddServiceEndpoint(typeof(ICustomerService), 

new BasicHttpBinding(), "CustomerService/V2"); 

D. Uri serviceAddress = 

new Uri("http://contoso.com:8080/"); 

ServiceHost host = 

new ServiceHost(typeof(ICustomerService), 

new Uri[] { serviceAddress }); 

host.AddServiceEndpoint(typeof(CustomerService), 

new BasicHttpBinding(), "CustomerService/V1"); 

host.AddServiceEndpoint(typeof(CustomerService), 

new BasicHttpBinding(), "CustomerService/V2"); 

Answer: C 


Q215. You are developing a Windows Communication Foundation (WCF) service. The service configuration file has a <System.Diagnostics> element defined. 

You need to ensure that all security audit information, trace logging, and message logging failures are recorded. 

Which configuration segment should you add to the <System.Diagnostics> element? 


A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer: C 


70-513  exam question

Renewal 70-513 exam guide:

Q216. You develop a Windows Communication Foundation (WCF) SOAP service that contains a class named Order. The Order class includes a field named secret that stores private data. 

The Order class includes the following code: 


The service has the following requirements: 

. The secret field must be encrypted. 

. All other fields in the Order class must serialize as plain text. You need to configure serialization for the Order class. 

What should you do? 

A. Add a MessageHeader attribute to the secret field and set the ProtectionLevel to Sign. 

Add a MessageBodyMember attribute to each of the other fields of the class. 

B. Add a MessageBodyMember attribute to the secret field and set the ProtectionLevel to Sign. 

Add a MessageBodyMember attribute to each of the other fields of the class. 

C. Add a MessageBodyMember attribute to the secret field and set the ProtectionLevel to EncryptAndSign. 

Add a MessageBodyMember attribute to each of the other fields of the class. 

D. Add a MessageHeader attribute to the secret field and set the ProtectionLevel to EncryptAndSign. 

Add a MessageBodyMember attribute to each of the other fields of the class. 

Answer: D 


Q217. You are developing a client that sends several types of SOP 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 SO6P message which code segment should you use 

A. [OperaionContract0sOneWay true, Action = ‘v’, ReplyAction void PostData(Order data); 

B. (OperationContract(1sOneWay = true, Action “v’, ReplyAction = “.‘) addPostData(BodyWriterdata); 

C. [OperaionContract] void PostDaa(BodyWriter data); 

D. [OperationContract] void PostDaa(Message data); 

Answer: D 


Q218. You are creating a Windows Communication Foundation (WCF) service based on WSHttpBinding. New audit requirements dictate that callers must be authenticated on every call to ensure that their credentials have not been revoked. 

You need to ensure that the service will not cache the security request token. 

What should you do? 

A. Apply a ServiceBehavior attribute to the service implementation class with the InstanceContextMode property set to Single. 

B. In the message security configuration, change clientCredentialType from IssuedToken to UserName. 

C. In the message security configuration, set establishSecurityContext to false. 

D. At the end of every operation, call the SessionStateUtility.RaiseSessionEnd method. 

Answer: C 


Q219. You are developing a Windows Communication Foundation (WCF) service. One of the parameters used with the service operations is a security token. The security token is not sensitive. The monitoring software tracks security tokens and can read tokens in clear text only. 

The company security policy requires that you validate all clear text data passed over the corporate network. 

You need to ensure that the service verifies that the security token is not changed during transit. 

What should you do? 

A. For all the security-sensitive members, set the ProtectionLevel parameter of the MessageBodyMember or MessageHeader attribute to EncryptAndSign. 

B. Implement IEndpointldentityProvider in the message contract class. 

C. Implement ISecureConversationSession in the message contract class. 

D. For all the security-sensitive members, set the ProtectionLevel parameter of the MessageBodyMember or MessageHeader attribute to Sign. 

Answer: D 


Q220. A Windows Communication Foundation (WCF) service handles online order processing for your company. 

You discover that many requests are being made with invalid account numbers. You create a class named AccountNumberValidator that has a method named Validate. 

Before the message is processed, you need to validate account numbers with AccountNumberValidator and reject messages with invalid account numbers. 

You create a new class that implements the IParameterInspector interface. Which code segment should you use in this class? 

A. Public Sub AfterCall( 

ByVal operationName As String, 

ByVal outputs() As Object, 

ByVal returnValue As Object, 

ByVal correlationState As Object) _ Implements 

IParameterInspector.AfterCall 

Dim accountNumber As String = GetAccountNumber(outputs) 

Dim validator As 

AccountNumberValidator = New AccountNumberValidator() 

If (Not validator.Validate(accountNumber)) Then 

Throw New FaultException() 

End If 

End Sub 

Public Function BeforeCall( 

ByVal operationName As String, 

ByVal inputs() As Object) As Object _ 

Implements IParameterInspector.BeforeCall 

Return Nothing 

End Function 

B. Public Sub AfterCall( 

ByVal operationName As String, 

ByVal outputs() As Object, 

ByVal returnValue As Object, 

ByVal correlationState As 

Object) _ 

Implements IParameterInspector.AfterCall 

Return 

End Sub 

Public Function BeforeCall( 

ByVal operationName As String, 

ByVal inputs() As Object) As Object _ 

Implements IParameterInspector.BeforeCall 

Dim accountNumber As String = GetAccountNumber(inputs) 

Dim validator As AccountNumberValidator = New AccountNumberValidator() If (Not 

validator.Validate(accountNumber)) Then 

Throw New FaultException() 

End If 

Return Nothing 

End Function 

C. Public Sub AfterCall( 

ByVal operationName As String, 

ByVal outputs() As Object, 

ByVal returnValue As Object, ByVal correlationState As Object) _ Implements IParameterInspector.AfterCall Dim accountNumber As String = GetAccountNumber(outputs) Dim validator As AccountNumberValidator = New AccountNumberValidator() If (Not validator.Validate(accountNumber)) Then returnValue = New FaultException() End If End Sub Public Function BeforeCall( ByVal operationName As String, ByVal inputs() As Object) As Object _ Implements IParameterInspector.BeforeCall Return Nothing End Function 

D. Public Sub AfterCall( 

ByVal operationName As String, 

ByVal outputs() As Object, 

ByVal returnValue As Object, 

ByVal correlationState As Object) _ 

Implements IParameterInspector.AfterCall 

Return 

End Sub 

Public Function BeforeCall( 

ByVal operationName As String, 

ByVal inputs() As Object) As Object _ 

Implements IParameterInspector.BeforeCall Dim accountNumber As String = 

GetAccountNumber(inputs) 

Dim validator As AccountNumberValidator = 

New AccountNumberValidator() 

If (Not validator.Validate(accountNumber)) Then 

Return New FaultException() 

End If 

End Function 

Answer: C 


certleader.com

Precise 70-513 Q&A:

Q221. A Windows Communication Foundation (WCF) service is responsible for transmitting XML documents between systems. 

The service has the following requirements: 

. It must minimize the transmission size by attaching the XML document as is without using escape characters or base64 encoding. . It must interoperate with systems that use SOAP but are not built on the .NET platform. 

You need to configure the service to support these requirements. 

Which message encoding should you use? 

A. Binary message encoding 

B. MTOM (Message Transmission Optimization Mechanism) message encoding 

C. Text message encoding with message version set to none 

D. Text message encoding with message version set to SOAP 1.2 

Answer: B 


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

You have the following requirements: 

Messages must be sent over TCP. 

The service must support transactions. 

Messages must be encoded using a binary encoding. 

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 t ransactionFlow 

D. binaryMessageEncoding transactionFlow tcpTransport windowsStreamSecurity 

Answer: B 


Q223. 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; } 

Answer: B 


Q224. Self-hosted Windows Communication Foundation (WCF) service uses a secure HTTP binding with a custom principal permission mode. 

The binding requires users to provide their Windows logon credentials. 

You need to retrieve the identity of the caller. 

What are two possible properties you can use to achieve this goal? (Each correct answer presents a complete solution Choose two) 

A. Thread.CurrentPrincipal.identityName 

B. HttpContext.Current.User.Identity.Name 

C. ServiceSecurityContext.Current.Primary.identity.Name 

D. OperationContext.Current.ServiceSecurityContext.PrimaryidentityName 

Answer: CD 


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


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" /> 

Answer: C 



see more 70-513 dumps