How to pass Microsoft 70-513 Real Exam in 24 Hours [practice test 16-30]

70-513 Royal Pack Testengine pdf

100% Actual & Verified — 100% PASS

Unlimited access to the world's largest Dumps library! Try it Free Today!

Get it now →

Product Description:
Exam Number/Code: 70-513
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

Free Certification Real IT 70-513 Exam pdf Collection

High value of 70-513 exam prep materials and practice for Microsoft certification for IT learners, Real Success Guaranteed with Updated 70-513 pdf dumps vce Materials. 100% PASS TS: Windows Communication Foundation Development with Microsoft .NET Framework 4 exam Today!

2016 Apr 70-513 Study Guide Questions:

Q16. A class named TestService implements the following interface. 


TestService is hosted in an ASP.NET applicator. 

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

What should you do? 

A. Add this attribute to the GetServiceTime method <webinvoke(Method “POST)> In the bconfig file, add this element to systemserviceModeI/behaviors/endpointBehaviors. <behavior names”Json”>e <enableWebScript 

c/behavior> 

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

as follows. 

<service name"TestService”>s 

<endpoint address/ServiceTime” 

contract-”TestSerAce”” 

behaviorConlfgurationz’Json 

bindinge”webHttpBinding”!> <!services 

B. Add this attribute to the GetServiceTime method 

<Webinvoke(Method PGETw, 

UrTemplate:eiSeneiceTim&, ResponseFormat: WebMessageFormatJson)> 

In the bconfIg file, configure TestService in the system.arviceModeI/services collection as 

follows. <senvice 

namee"TestService”> <endpoint ad&esse"ISer,iceTime”r 

contracte"TestSence’ bindingewebHttpBindngw /> 

c/service> 

C. Add this attribute to the GetServiceTime method 

<webGet( 

ResponseFormat WebMessageFormatJson, 

UnTemplate:eJServiceTime")>? 

Create a new svc file named Jsonversion svc with the following contract <%@ ServiceHost 

Servicee"TessService”i 

Factory="System ServiceModelktivation WebServiceHosFactory" %s 

D. Add this attribute to the GetServiceTime method 

<WebGet(UriTempbte: z”{Json}/ServiceTime”)> 

Create a new svc file named Jsonversionsvc with the following contert <%@ ServiceHost 

Service=”TestSenvice” 

Factoryz’System Se viceMode[ktivationWebServiceHodFactory" %> 

Answer: C 


Q17. You create a Windows Communication Foundation (WCF) service and deploy it with wsHttpBinding and message security enabled. 

You create an intermediate WCF service for logging messages sent to the primary service. The intermediate service is called via the clientVia endpoint behavior. 

The primary service is receiving malformed data from a client application. 

You need to enable inspection of the malformed data and prevent message tampering. 

What should you do? 

A. Specify a protection level of None in the service contract for the intermediate service. Disable message and transport security from the client application configuration file. 

B. Specify a protection level of Sign in the service contract for the intermediate service. Disable transport security from the client application configuration file. 

C. Modify the binding on the intermediate service to use netNamedPipeBinding. 

D. Modify the binding on the intermediate service to use webHttpBinding. 

Answer: B 


Q18. You have an existing Windows Communication Foundation (WCF) service that exposes a service contract over HTTP using explicit binding configuration. 

You need to expose that contract over HTTP and TCP. 

What should you do? 

A. Add a net.tcp base address to the host. 

B. Add an endpoint configured with a netTcpBinding. 

C. Add an endpoint behavior named netTcpBehavior to the existing endpoint. 

D. Add a binding configuration to the existing endpoint named netTcpBinding. 

Answer: B 


Q19. You develop a Windows Communication Foundation (WCF) service to generate reports. Client applications call the service to initiate report generation but do not wait for the reports to be generated. The service does not provide any status to the client applications. 

The service class is defined as follows. (Line numbers are included for reference only.) 


You need to ensure that client applications can initiate reports without waiting for status. 

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

A. Insert the following code at line 04. [OperationContract(IsOneWay=true)] 

B. Insert the following code at line 04. [OperationContract(AsyncPattern=false)] 

C. At line 05, change the GenerateReports method from private to public. 

D. Remove line 08. At line 05, change the return type of GenerateReports method to void. 

Answer: AD 


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

Function GetCustomerInformation( 

ByVal header As Header, 

ByVal customerNumber As Integer) 

As CustomerInformation 

End Interface 

<DataContract()> 

Public Class CustomerInformation 

End Class 

<MessageContract()> 

Public Class Header 

<MessageHeader()> 

Public SecurityTag As String 

End Class 

B. <ServiceContract()> 

Public Interface IService 

<OperationContract()> 

Function GetCustomerInformation( 

ByVal header As Header, ByVal customerNumber As Integer) As CustomerInformation End Interface <MessageContract()> Public Class CustomerInformation End Class <MessageContract()> Public Class Header <MessageHeader()> Public SecurityTag As String End Class 

C. <ServiceContract()> Public Interface IService <OperationContract()> Function GetCustomerInformation( ByVal request As CustomerNumber) As CustomerInformation End Interface <DataContract()> Public Class CustomerInformation End Class <MessageContract()> Public Class CustomerNumber <MessageHeader()> Public SecurityTag As String <MessageBodyMember()> Public CustomerNumberElement As Integer End Class 

D. <ServiceContract()> Public Interface IService <OperationContract()> Function GetCustomerInformation( ByVal request As CustomerNumber) As CustomerInformation End Interface <MessageContract()> Public Class CustomerInformation End Class <MessageContract()> Public Class CustomerNumber <MessageHeader()> Public SecurityTag As String <MessageBodyMember()> Public CustomerNumberElement As Integer End Class 

Answer: D 


70-513 practice exam

Update 70-513 exam cram:

Q21. You are developing a client application that consumes a Windows Communication Foundation (WCF) service. The operation contract is as follows. 

[OperationContract] 

[FaultContract(typeof(SalesFault))] 

string GetSales(string saleld); 

The service configuration file contains the following line in the serviceBehaviors section. 

<behavior> 

<serviceDebug inc1udeExceptionDetoillnFauIts-"True"/> 

</behavior> 

A divide-by-zero exception is not being handled by the service. 

You need to ensure that the exception is caught in the client application. 

Which type of exception should the client catch? 

A. TimeoutException 

B. FaultException 

C. DivideByZeroException 

D. FaultException<SalesFault> 

Answer: B 


Q22. You are developing a Windows Communication Foundation (WCF) service that reads messages from a public non-transactional MSMQ queue. 

You need to configure the service to read messages from the failed-delivery queue. 

Which URI should you specify in the endpoint configuration settings of the service? 

A. net.msmq://localhost/msmq$;FailedMessages 

B. net.msmq://localhost/msmq$;DeadLetter 

C. net.msmq://localhost/system$;DeadXact 

D. net.msmq://localhost/system$;DeadLetter 

Answer: D 


Q23. You develop a Windows Communication Foundation (WCF) service. 

You name the service MovieService in the Movie namespace. The service is hosted in Microsoft Internet Information Services (IIS). You copy the assembly containing the service to the bin folder in the virtual directory path. 

You need to set up the URI that is mapped to the service. 

What should you do? 

A. Add a Movie.svc file in the root of the virtual path with the following line. <*8ServiceHost 

language""VB" Service "MovieService. svc "*> 

B. Add the following code segment to the web.config file. 

<3erviceHostingEnvironment> 

<serviceActivations> 

<add relativeAddress="./Movie.svc" 

service="Movie.MovieService"/> 

</serviceActivacions> 

</serviceHostingEnvironment> 

C. Add a Movie.svc file in the root of the virtual path with the following line. 

<%@ServiceHosc language="VB" Service="MovieService"%> 

D. Add the following code segment to the web.config file. 

<serviceHostingEnvironment> 

<serviceActivacions> 

<add reiativeAddress="./Movie" 

service="Movie.MovieService"/> 

</serviceActivations> 

</serviceHostingEnvironmenc> 

Answer: B 


Q24. You are moving a Windows Communication Foundation (WCF) service into production. 

You need to be able to monitor the health of the service. You only want to enable all performance counter instances exposed by the ServiceModelService 4.0.0.0 counter group. 

Which element should you add to the system.serviceModel section in the application configuration file? 

A. <diagnostics performanceCounters="ServiceOnly" /> 

B. <diagnostics wmiProviderEnabled="true" performanceCounters="Off" /> 

C. <diagnostics performanceCounters="All" /> 

D. <diagnostics wmiProviderEnabled="true" /> 

Answer: A 


Q25. 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 <OperationBehavior (TransactionScopeRequired:=False) > to the service operation. 

C. Set the service binding receiveTimeout attribute to 00:00:45. 

D. Apply OerviceBehavior (TransactlonTiitieout: = "00:00:45")> to the service implementation. 

Answer: D 


70-513 dumps

Tested 70-513 secret:

Q26. A Windows Communication Foundation (WCF) solution uses the following contract to share a message across its clients. 

(Line numbers are included for reference only.) 

01 [ServiceContract] 

02public interface ITeamMessageService 

03{ 

04 [OperationContract] 

05string GetMessage0; 

07 [OperationContract] 

08void PutMessage(string message); 

09) 

The code for the service class is as follows 

10 public class TeamMessageService: ITeamMessageService 

1 1{ 

12Guid key = GuicLNewGuidO; 

1 3string message = “Today’s Message”: 

1 4public string GetMessage() 

i5{ 

16 return stringFormat(”Message:{0} Key:{1}”, 

message, Key); 

1n 

1 9public void PutMessage(string message) 

20{ 

2lthismessage = message; 

22} 

23) 

The senvice is self-hosted. The hosting code is as follows. 

24 ServiceHost host = 

25BasicHttpBinding binding = 

new BasicHttpBinding(BasicHttpSecuntyMode.None): 

26 host AddServiceEndpoint( 

HMyApplication lTeamMessageService, binding, 

“http:/Ilocalhost: 12345w); 

27 host Open0;) 

You need to ensure that all clients calling GetMessage will retrieve the same string, even if the message is updated by clients calling PutMessage 

What should you do? 

A. Add the following attribute to the TeamMessageService class, before line 10. 

[ServiceBehavior(lnstanceContextMode = lnstanceContextMode. Single)] 

B. Add the following attribute to the TeamMessageService class, before line 10. 

[ServiceBehavior(lnstanceContextMode = lnstanceContextModePerSession)J Then 

change the binding definition on the service at line 25, and on the client to the following 

WSHttpBinding binding new 

WSHttpBinding(SecurityModeNone); 

binding ReliableSession. Enabled true; 

C. Pass a service instance to the instancing code in line 24, as follows. 

ServiceHost host = new ServiceHost(new TeamMessageServiceO); 

D. Redefine the message string in line 13, as follows 

static string message = ‘Today’s Message”: 

Then change the implementation of PutMessage in lines 19-22 to the following 

public void PutMessage(string message) { TeamMessageServicemessage message, 

Answer: A 


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

 [ServiceContract(SessionMode SessionModeAllowed)] public interface IMyService { 

[OperaionContractQsTerminating false) void lnitialize0; 

[OperaionContractQslnitiating false)] Void DoSomethingO; 

[OperaionContractQsTerminating true)J void TerminateO; 

You need to change this interface so that: 

‘Initialize is allowed to be called any time before Terminate is called 

“DoSomething is allowed to be called only after Initialize is called, and n allowed to be called after Terminate is called “Terminate will be lowed 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 IMyService interface to the following. ServiceContract(SessionMode = SessionMode Required) 

B. Change the ServiceContract attribute of the IMyService interface to the following ServiceContract(SessionMode SessionMode Allowed) 

C. Change the OperationContract attribute of the Initialize operation to the following. OperationContract(initiating = true, IsTerminating = false) 

D. Change the OperationContract attribute of the Terminate operation to the following OperationContract(klnitiating = fase, IsTerminating = true) 

Answer: AD 


Q28. You are developing a Windows Communication Foundation (WCF) service that returns location information for authorized law enforcement agencies. The service contract is as follows. 

[ServiceContract] 

public interface IMappingService 

[OperationContract] 

long[] GetLocationCoordinates(String cityNaroe); 

[OperationContract] 

long[] GetLocationOfCitizen(String ssn) ; 

Users are authenticated and impersonated. The system uses ASP.NET roles. The members of law enforcement are members of the LawEnforcement role. 

You need to ensure that only members of the LawEnforcement role can call these methods. 

What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.) 

A. Add a PrincipalPermissionAttribute to each method that should be available only to members of law enforcement. Set its SecurityAction to Demand and set the role equal to LawEnforcement. 

B. Use the CurrentPrincipal property of the thread. Call the IsInRole method specifying LawEnforcement as a parameter. 

C. Create a GenericPrincipal specifying Thread.CurrentPrincipal.Identity as the IldentityParameter and LawEnforcement as the only value for the Roles parameter. 

D. At the beginning of each method, enumerate each ClaimSet in a new WindowsClaimSet. Use the FindClaims method to locate a claim type named Role with a right named LawEnforcement. 

Answer: AB 


Q29. Four Windows Communication Foundation (WCF) services are hosted in Microsoft Internet Information Services (IIS). No behavior configuration exists in the web.config file. 

You need to configure the application so that every service and endpoint limits the number of concurrent calls to 50 and the number of concurrent sessions to 25. 

Which XML segment should you add to the system.serviceModel configuration section of the web.config file? 

A. <behaviors> 

<serviceBehaviors> 

<behavior name="*"> 

<serviceThrottling maxConcurrentCalls="50" maxConcurrentSessions="25"/> 

</behavior> 

</serviceBehaviors> 

</behaviors> 

B. <behaviors> 

<serviceBehaviors> 

<behavior name="default"> 

<serviceThrottling maxConcurrentCalls="50" maxConcurrentSessions="25"/> 

</behavior> 

</serviceBehaviors> 

</behaviors> 

C. <behaviors> 

<serviceBehaviors> 

<behavior name=""> 

<serviceThrottling maxConcurrentCalls="50" maxConcurrentSessions="25"/> 

</behavior> </serviceBehaviors> </behaviors> 

D. <behaviors> 

<serviceBehaviors> 

<behavior name="ALL"> 

<serviceThrottling maxConcurrentCalls="50" maxConcurrentSessions="25"/> 

</behavior> 

</serviceBehaviors> 

</behaviors> 

Answer: C 


Q30. You develop a Windows Communication Foundation (WCF) service. You enable all performance counters and run multiple calls to the service. 

The service must isolate session data for each user. 

You need to monitor the instancing behavior used in the service. 

Which performance counter should you monitor? 

A. ServiceModelService 4.0.0.0\Calls 

B. ServiceModelService 4.0.0.0\Instances 

C. ASP.NET State Service\State Server Sessions Active 

D. ASP.NET State Service\State Server Sessions Total 

Answer: B 



see more 70-513 - TS: Windows Communication Foundation Development with Microsoft .NET Framework 4