15 tips on How to 70-513 Test Like a Badass

★ Pass on Your First TRY ★ 100% Money Back Guarantee ★ Realistic Practice Exam Questions

Free Instant Download NEW 70-513 Exam Dumps (PDF & VCE):
Available on: https://www.certleader.com/70-513-dumps.html


70-513 Product Description:
Exam Number/Code: 70-513 vce
Exam name: TS: Windows Communication Foundation Development with Microsoft .NET Framework 4
n questions with full explanations
Certification: Microsoft Certification
Last updated on Global synchronizing

Instant Access to Free VCE Files: Microsoft 70-513 TS: Windows Communication Foundation Development with Microsoft .NET Framework 4

70-513 examcollection

Question No. 46

A Windows Communication Foundation (WCF) service is self-hosted in a console application. The service implements the IDataAccess contract, which is defined in the MyApplication namespace. 

The service is implemented in a class named DataAccessService, which implements the IDataAccess interface and also is defined in the MyApplication namespace. 

The hosting code is as follows. (Line numbers are included for reference only.) 


You need to create a ServiceHost instance and assign it to the host variable. You also need to instantiate the service host. 

Which line of code should you insert at line 04? 

A. host = New ServiceHost("MyApplication.DataAccessService") 

B. host = New ServiceHost("MyApplication.IDataAccess") 

C. host = New ServiceHost(GetType(IDataAccess)) 

D. host = New ServiceHost(GetType(DataAccessService)) 

Answer:


Question No. 47

You develop a Window Communication Foundation (WCF) service. 

You have the following requirements: 

. Create a data contract to pass data between client applications and the service. . Create the data that is restricted and cannot pass between client applications and the service. 

You need to implement the restricted data members. 

Which member access modifier should you use? 

A. Private 

B. Protected 

C. Public 

D. Static 

Answer:


Question No. 48

A 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.Identity-Name 

B. HttpContext.Current.User.Identity.Name 

C. ServiceSecurity Context.Current.Primary Identity.Name 

D. OperationContext.Current.ServiceSecurity Context.Primary Identity.Name 

Answer: CD 


Question No. 49

Your company has an existing Windows Communication Foundation (WCF) service that allows business partners to place orders. The service uses netMsmqBinding. 

You find that processing every order in its own transaction is causing a delay. 

You need to ensure that the service is configured to process multiple orders in one transaction. 

What should you do? 

A. Use <serviceThrottling> service behavior and set the maxConcurrentCalls attribute. 

B. Use <transactedbatching> endpoint behavior and set the maxBatchSize attribute. 

C. Use <dispatcherSynchronizationBehavior> endpoint behavior and set the maxPendingReceives attribute. 

D. Use <synchronousReceive> endpoint behavior. 

Answer:


Question No. 50

You are developing a Windows Communication Foundation (WCF) service to provide shopping cart support. ASP.NET compatibility mode is not enabled. 

The shopping cart information must be retained across user visits to the store until the user explicitly empties the cart or submits the cart contents to order. 

You need to implement the service as a DurableService. 

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

A. Use basicHttpBinding for both the client application and the service. 

B. Create the persistence provider database and configure the persistenceProvider element of the service behavior to point to that database. 

C. Use wsHttpContextBinding for both the client application and the service. 

D. In the method to add an item to the shopping cart, serialize the shopping cart contents after adding the current item and storing it in a Session variable. 

Answer: BC 


Question No. 51

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:


Question No. 52

A Windows Communication Foundation (WCF) client configuration file contains the following XML segment in the system.serviceModel element. 

<client> 

<endpoint address=" net.tcp://server/ContosoService " 

binding=" netTcpBinding " 

contract=" Contoso. IContoso Service " 

name=" netTcp " / > 

<endpoint address=" net.pipe://localhost/ContosoService " 

binding=" netNamedPipeBinding " 

contract=" Contoso. IContoso Service " 

name=" netPipe " /> 

</client> 

You need to create a channel factory that can send messages to the endpoint listening at net.pipe://localhost/ContosoService. 

Which code segment should you use 

A. Dim factory As ChannelFactory (Of Contoso. IContosoService ) = 

New ChannelFactory (Of Contoso. IContosoService )(" Contoso. IContosoService ") 

B. Dim factory As ChannelFactory (Of Contoso. IContosoService ) = 

New ChannelFactory (Of Contoso. IContosoService )(" netNamedPipeBinding ") 

C. Dim factory As ChannelFactory (Of Contoso. IContosoService ) = 

New ChannelFactory (Of Contoso. IContosoService )(" netPipe ") 

D. Dim factory As ChannelFactory (Of Contoso. IContosoService ) = 

New ChannelFactory (Of Contoso. IContosoService )( 

" net.pipe://localhost/ContosoService ") 

Answer:


Question No. 53

You are creating an application that consumes a Windows Communication Foundation (WCF) service. The service implements the IService contract. The client application contains the CallbackHandler class, which implements IServiceCallback. 

You need to ensure that a client proxy is created that can communicate with the service over a duplex channel. 

Which code segment should you use? 

A. var handler = new CallbackHandler(); 

var clientFactory = new DuplexChannelFactory<IService>{ 

new WSHttpContextBinding() ; 

var clienc = clientFactory.CreateChannelt 

new InstanceContext (handler) , new EndpointAddress ("... ")); 

B. var handler = new CallbackHandler(); 

var clientFactory = 

new DuplexChonnelFaccory<IService>{ 

typeof(CallbackHandler), new WSDualHttpBinding ()); var client = 

clientFactory.CreateChannel( 

new InstanceContext (handler) , new EndpointAddress ("...")) ; 

C. var handler = new CallbackHandler(); 

var clientFactory = new DuplexChannelFactory<IService>{ 

new WSHttpBinding()); 

var client = clientFactory.CreateChannel( 

new InstanceContext (handler) , new EndpointAddress ("...")) ; 

D. var handler = new CallbackHandler(); 

var clientFactory = new DuplexChannelFactory<IService>{ 

typeof(CallbackHandler), new WSDualHttpBinding()); 

var client = clientFactory.CreateChannel( 

new EndpointAddress ("...")) ; 

Answer:


Question No. 54

You are creating a Windows Communication Foundation (WCF) service that accepts messages from clients when they are started. The message is defined as follows. 

[MessageContract] 

public class Agent 

public string CodeName { get; set; } 

public string SecretHandshake { get; set; } 

You have the following requirements: 

. The CodeName property must be sent in clear text. The service must be able to verify that the property value was not changed after being sent by the client. 

. The SecretHandshake property must not be sent in clear text and must be readable by the service. 

What should you do? 

A. Add a MessageBodyMember attribute to the CodeName property and set the ProtectionLevel to Sign. Add a MessageBodyMember attribute to the SecretHandshake property and set the ProtectionLevel to EncryptAndSign. 

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

C. Add an XmlText attribute to the CodeName property and set the DataType property to Signed. Add a PasswordPropertyText attribute to the SecretHandshake property and set its value to true. 

D. Add an ImmutableObject attribute to the CodeName property and set its value property to true. Add a Browsable attribute to the SecretHandshake property and set its value to false. 

Answer:


Question No. 55

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


A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:


Question No. 56

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


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 22. throw; 

B. Insert the following line at line 09. [ServiceBehavior( TransactionAutoCompleteOnSessionClose = false)] 

C. Replace line 12 with the following line. [OperationBehavior( TransactionScopeRequired = true, TransactionAutoCoroplete - false)] 

D. Insert the following line at line 09. [ServiceBehavior( TransactionAutoCompleteOnSessionClose = true)] 

Answer:


Question No. 57

You are configuring services to be discoverable. The services must be discoverable without relying on a central server. Client applications that consume the services are on a network segment that is separate from the network segment that the services are located on. 

A firewall blocks all TCP ports between the two network segments, but allows other protocols to pass through. 

You need to ensure that the client applications can discover the services. 

What should you do? 

A. Use ad-hoc discovery mode over HTTP. 

B. Use ad-hoc discovery mode over UDP. 

C. Use managed discovery mode over HTTP. 

D. Use managed discovery mode over UDP. 

Answer:


Question No. 58

You have a Windows Communication Foundation (WCF) service. 

The service has issues with performance when it receives messages on a specific endpoint. The service must collect the minimum number of performance counters to diagnose the message issues. 

You need to configure the service. 

In the web.config file for the service, what should you do? 

A. In the service configuration diagnostics section, set the value of the performancCounters property to All. 

B. Enable the Windows Management Instrumentation (WMI) provider. 

C. In the service configuration diagnostics section, set the value of the performanceCounters property to ServiceOnly. 

D. Enable message logging for the endpoint. 

Answer:


Question No. 59

You are implementing a Windows Communication Foundation (WCF) client application that consumes the ICatalog and lCatalog2 service interfaces 

You need to ensure that the client discovers services implementing these interfaces 

The services may already be online or may come online within a 30 second time limit 

How should you use WCF Discovery to accomplish this? 

A. Create one FindCriteria object for each interface and set the Duration of each FindCriteria to 30 seconds Call the FindAsync method of the DiscoveryClient class twice, one time for each of the FindCriteria objects, to search for the services. 

B. Create one FindCriteria object for each interface and set the Duration of each FindCriteria to two seconds. 

Create a loop that calls the Find method of the DiscoveryClient class to search for the services. 

Within each loop iteration, call the Find method of the DiscoveryClient class once for each of the FindCriteria objects Run the loop until a service is found or 30 seconds pass. 

C. Create a single FindCriteria object and add both interfaces to its ContractTypeNames collection. Set the criteria's Duration to two seconds. 

Create a loop that calls the Find method of the DiscoveryClient class to search for the services. 

Within each loop iteration, call the Find method of the DiscoveryClient class to search for the services Run the loop until a service is found or 30 seconds pass. 

D. Create a single FindCritera object and add both interfaces to the ContractTypeNames collection. Set the Duration to 30 seconds and use the FindAsync method of the DiscoveryClient class to search for the services. 

Answer:


Question No. 60

A service implements the following contract. (Line numbers are included for reference only.) 


ContosoService uses NetMsmqBinding to listen for messages. The queue was set up to use transactions for adding and removing messages. 

You need to ensure that OperationOne and OperationTwo execute under the same transaction context when they are invoked in the same session. 

What should you do? 

A. Insert the following attribute to OperationOne on IContosoService. 

[TransactionFlow(TransactionFlowOption.Mandatory)] 

Insert the following attribute to OperationTwo on IContosoService. 

[TransactionFlow(TransactionFlowOption.Mandatory)] 

B. Insert the following attribute to OperationOne on ContosoService. 

[OperationBehavior(TransactionScopeRequired = true, 

TransactionAutoComplete = false)] 

Insert the following attribute to OperationTwo on ContosoService. 

 [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)] 

C. Add the following XML segment to the application config file in the 

system.serviceModel/bindings configuration section. 

<netMsmqBinding> 

<binding name="contosoTx" durable="true" receiveContextEnabled="true" /> 

</netMsmqBinding> 

Then use the NetMsmqBinding named contosoTx to listen for messages from the clients. 

D. Add the following XML segment to the application config file in the 

system.serviceModel/bindings configuration section. 

<customBinding> 

<binding name="contosoTx"> 

<transactionFlow /> 

<binaryMessageEncoding /> 

<msmqTransport durable="true" /> 

</binding> 

</customBinding> 

Then use the CustomBinding named contosoTx to listen for messages from the clients. 

Answer: