[Latest] ms press 70-513

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.

2016 Jun 70-513 Study Guide Questions:

Q196. You are developing a Windows Communication Foundation (WCF) service to replace an existing A5MX Web service. 

The WCF service contains the following code segment. (Line numbers are included for reference only.) 

The existing Web service returns the EmployeeID as an attribute of the EmployeeInfo element in the response XML. 

You need to ensure that applications can consume the service without code changes in the client. 


A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer: C 


Q197. You are developing a Windows Communication Foundation (WCF) service. One of the service operations contains the following code. 


A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer: C 


Q198. A Windows Communication Foundation (WCF) service is self-hosted in a console application. 

The service implements the ITimeService service interface in the TimeService class. 

You need to configure the service endpoint for HTTP communication. 

How should you define the service and endpoint tags? 

A. Define the service tag as follows. 

<service name="ITimeService"> 

Define the endpoint tag as follows. 

< endpoint kind ="TimeService" 

address="http://localhost:8080/TimeService" 

binding="wsHttpBinding" 

contract="ITimeService"/> 

B. Define the service tag as follows. 

<service name="TimeService"> 

Define the endpoint tag as follows. 

< endpoint kind="TimeService" 

address="http://localhost:8080/TimeService" 

binding="wsHttpBinding" 

contract="ITimeService"/> 

C. Define the service tag as follows. 

<service name="ITimeService"> 

Define the endpoint tag as follows. 

< endpoint name="TimeService" 

ddress="http://localhost:8080/TimeService" 

binding="wsHttpBinding" 

contract="ITimeService"/> 

D. Define the service tag as follows. 

<service name="TimeService"> 

Define the endpoint tag as follows. 

<endpoint address="http://localhost:8080/TimeService" 

binding="wsHttpBinding" 

contract="ITimeService"/> 

Answer: D 


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

Answer: C 


Q200. You are creating a windows Communication Foundation (WCF) service to process orders. 

The data contract for the order is defined as follows: 

[DataContract] 

public class Order 

… 

[DataMemberl 

public string CardHolderName { get; set; 

[DataMember] 

public string CreditCardNumber { get; set; } 

You have the following requirements 

. Enable the transmission of the contents of Order from the clients to the service. 

. Ensure that the contents of CreditCardNumber are not sent across the network in clear text. 

. Ensure that the contents of CreditCardNumber are accessible by the service to process the order. 

You need to implement the service to meet these requirements. 

What should you do? 

A. Add a DataProtectionPermission attribute to the CreditCardNumber property and set the ProtectData property to true. 

B. Convert the DataContract to a MessageContract and set the ProtectionLevel property to SignAndEncrypt 

C. Change the data type of CreditCardNumber from string to SecureString 

D. Implement the CreditCardNumber property getter and setter. In the setter, run the value of the CreditCardNumber through the MD5CryptoServiceProvider class TransformBlock method 

Answer: B 


70-513  test

Down to date exam 70-513 amazon:

Q201. You develop a Windows Communication Foundation (WCF) service that employees use to access bonus information. You define the following service contract. (Line numbers are included for reference only.) 

01 <ServiceContract(SessionMode:=SessionMode.Required)> 02 Public Interface IFinancialService 03 04 <OperationContract()> 05 Function Login( ByVal employeeID As Integer, ByVal passwordHash As String) As String 06 07 <OperationContract()> 08 Function GetBonus(ByVal month As Integer) As Double 09 10 <OperationContract (IsTerminating:=True)> 11 Sub Logout() 12 13 End Interface 

Client applications can invoke methods without logging in. 

You need to ensure that the client applications invoke Login before invoking any other method. 

You also need to ensure that client applications cannot consume the service after invoking Logout. 

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

A. Replace line 04 with the following code. <OperationContract(IsInitiating:=False)> 

B. Replace line 04 with the following code. <OperationContract(IsInitiating:=True, IsTerminating:=True)> 

C. Replace line 07 with the following code. <OperationContract(IsInitiating:=False)> 

D. Replace line 10 with the following code. <OperationContract(IsInitiating:=False, IsTerminating:=True)> 

Answer: CD 


Q202. 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. Implement IEndpointldentityProvider in the message contract class. 

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

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

D. Implement ISecureConversationSession in the message contract class. 

Answer: C 


Q203. 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 Property CodeName As String 

Public Property SecretHandshake As String 

End Class 

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: B 


Q204. You are creating a windows Communication Foundation (WCF) service to process orders. 

The data contract for the order is defined as follows: 

[DataContract]> 

public class Order 

[DataMemberl ()> 

public string CardHolderName { get; set; 

[DataMember] > 

public string CreditCardNumber { get; set; } 

You have the following requirements: 

. Enable the transmission of the contents of Order from the clients to the service. 

. Ensure that the contents of CreditCardNumber are not sent across the network in clear text. 

. Ensure that the contents of CreditCardNumber are accessible by the service to process the order. 

You need to implement the service to meet these requirements 

What should you do? 

A. Add a DataProtectionPermission attribute to the CreditCardNumber property and set the ProtectData property to true. 

B. Convert the DataContract to a MessageContract and set the ProtectionLevel property to SignAndEncrypt 

C. Change the data type of CreditCardNumber from string to SecureString 

D. Implement the CreditCardNumber property getter and setter In the setter, run the value of the CreditCardNumber through the MD5CryptoServiceProvider class TransformBlock method 

Answer: B 


Q205. 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 <ServiceContract0> 

02PuElic Interface ITeamMessageService 

04 <OperationContractO> 

05Function GetMessage() As String 

06 

07 <OperationContract0> 

08Sub PutMessage(Byval message As String) 

O9End Interface 

The code for the serAce class is as follows. 

10 Public Class TeamMessageService0 

11 Implements lTearmt4essageService 

12 

1 3Dim key As Guid = Guid.NewGuid() 

1 4Dim message As String = “Today's Message’ 

15 

16PuUic Function GetMessage0As String -1 7lmpements lTearm*AessageServiceGetMessage 

18 

1 9Retun String. Fommat(”Message:{0) Key:{ 1}”, message, key) 

20End Function 

21 

22PubIic Sub PutMessage(ByV message As Stnng) -23lmpements lTearrlessageService PutMessage 

24 

25Me message = message 

26End Sub 

27 

28End Class 

The service is self-hosted The hosting code rs as follows 

29Dim host As ServiceHost = 

New ServiceHost(GetType(TearrwiessageSeMce))? 

3ODim binding As Basic HttpBindngt 

New BasicHttpBindiig(BasicHttpSecurityMode. None) 31 host.AddServiceEndpoint( 

“MyAppication lTearrtAessageService”, binding 

Thttp /Ilac aihost. 1 2345) 

32host Open() 

You need to ensure that all clients calling GetMessage will retrieve the same string, even if the message is upd(ed by clients calling PutMessage what should you do? 

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

<ServceBehavior(lnstanceContextMode lnstanceContextMode. Single)> 

B. Add the following attribute to the TeamMessageService class, before line 1 0002E 

<ServiceBehavior( lnstanceContextll ode. = InstanceContextMode. PerSession)> 

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

Dim host As ServiceHost z New ServiceHost(New TeamMessageServiceO) 

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

Shared message As String “Today's Message” 

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

Public Sub PutMessage(ByVal message As rng) - Implements ITean-MessageService.PutMessage 

TeamMessageSenAce.message = message End Sub 

Answer: A 


70-513  test

100% Guarantee 70-513 online test:

Q206. A Windows Communication Foundation (WCF) service implements the following contract. (Line numbers are included for reference only.) 

01 [ServiceContract] 

02 public interface IDataAccessService 

03 { 

01 [OperationContract] 

05 void PutMessage(string message); 

07 [OperationContract] 

08 [FaultContract(typeof(TimeoutFaultException)) ] 

09 [FaultContract(typeof(FaultException) ) ] 

10 stringf] SearchMessages(string search); 

11 } 

The implementation of the SearchMessages method throws TimeoutFaultException exceptions for database timeouts. The implementation of the SearchMessages method also throws an Exception for any other issue it encounters while processing the request. These exceptions are received on the client side as generic FaultException exceptions. 

You need to implement the error handling code for SearchMessages and create a new channel on the client only if the channel faults. 

What should you do? 

A. Catch and handle both TimeoutFaultException and FaultException 

B. Catch both TimeoutFaultException and FaultException. Create a new channel in both cases. 

C. Catch and handle TimeoutFaultException.Catch FaultException and create a new channel. 

D. Catch and handle FaultException.Catch TimeoutFaultException and create a new channel. 

Answer: C 


Q207. 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 ASP.NET Forms Authentication model. 

You add a service file named Authentication.svc that contains the following code segment. 

<%@ ServiceHost 

Service="System.Web.ApplicationServices.AuthenticationService" 

Factory="System.Web.ApplicationServices.ApplicationServicesHostFactory" %> 

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.Web.ApplicationServices.AuthenticationService. 

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

Answer: AC 


Q208. You are creating a Windows Communication Foundation (WCF) service that implements operations in a RESTful manner. You need to add a delete operation. 

You implement the delete method as follows. 

Sub DeleteItems (ByVol id As String) 

You need to configure WCF to call this method when the client calls the service with the HTTP DELETE operation. 

What should you do? 

A. Add the WebInvoke(UriTemplate: = "/Items/{id>", Method: = "DELETE") attribute to the operation. 

B. Add the HttpDelete attribute to the operation. 

C. Replace the string parameter with a RemovedActivityAction parameter. 

D. Change the Sub statement to Function and specify RemovedActivityAction as the return type. 

Answer: A 


Q209. You are developing a client application that uses the following code to consume a Windows 

Communication Foundation (WCF) service. (Line numbers are included for reference only.) 

01 Dim myBinding As BasicHttpBinding = 

New BasicHttpBinding() 

02 Dim myEndpointAddress As EndpointAddress = 

New EndpointAddress( 

"http://contoso.com/TaxService.svc") 

04 Dim client As ITaxService = 

channelFactory.CreateChannel() 

05 Dim data As String = client.GetData(1) 

You need to consume the service. 

Which code segment should you insert at line 03? 

A. Dim channelFactory = 

New ChannelFactory(Of ITaxService)() 

B. Dim channelFactory = 

New ChannelFactory(Of ITaxService)(myBinding) 

C. Dim channelFactory = 

New ChannelFactory(Of ITaxService) 

(myBinding, myEndpointAddress) 

D. channelFactory = 

New ChannelFactory(Of ITaxService) 

("http://contoso.com/TaxService.svc") 

Answer: C 


Q210. You are developing a Windows Communication Foundation (WCF) service. You write a method named Submit that accepts messages of the type System.ServiceModel.Channels.Message. 

You need to process the body of the incoming messages multiple times in the method. 

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

A. Use the GetBody method of the Message class to read the content of the messages. 

B. Use the CreateBufferedCopy method of the Message class to load the messages into memory. 

C. Use the WriteBodyContents method of the BodyWriter class to make a copy of the messages. 

D. Use the CreateMessage method of the MessageBuffer class to make a copy of the messages. 

Answer: BD 



see more 70-513 dumps