Up to date 70-513: Examcollection real braindumps from 1 to 15

Question No. 1

The endpoint of a Windows Communication Foundation (WCF) service uses basicHttpBinding for its binding. Your company's policies have changed to require that messages not be sent in clear text. 

You must ensure that all messages are encrypted when traveling across the network. 

What should you do? 

A. Set the ProtectionLevel property on the service contract and update the binding attribute in the endpoint element of the configuration file to wsHttpBinding. 

B. Set the ProtectionLevel property on the service contract and update the bindingConfiguration attribute in the endpoint element of the configuration file to webHttpBinding. 

C. Set the PrincipalPermissionAttribute on the service contract and update the binding attribute in the endpoint element of the configuration file to wsHttpBinding. 

D. Set the PrincipalPermissionAttribute on the service contract and update the bindingConfiguration attribute in the endpoint element of the configuration file to wsHttpBinding. 

Answer:


Question No. 2

You are developing a Windows Communication Foundation (WCF) service named CalculatorService, which implements the ICalculatorService contract. The service is configured to be discoverable through UDP. CalculatorService contains multiple endpoints. One of the endpoints is configured with the following behavior. 

You need to log all the endpoint metadata information that is added by the service host. Which code segment should you use? 


A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:


Question No. 3

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

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

01 static void Main(string[] args) 

02 { 

03 ServiceHost host; 

05 host.Open(); 

06 Console.ReadLine(); 

07 host.Close(); 

08 } 

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(typeof(IDataAccess)); 

D. host = new ServiceHost(typeof(DataAccessService)); 

Answer:


Question No. 5

A Windows Communication Foundation (WCF) solution exposes the following service over a TCP binding. (Line numbers are included for reference only.) 

01 [ServiceContract] 

02 [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)] 

03 public class DataAccessService 

04 { 

05 [OperationContract] 

06 public void PutMessage(string message) 

07 { 

08 MessageDatabase.PutMessage(message); 

09 } 

10 [OperationContract] 

11 public string[] SearchMessages(string search) 

12 { 

13 return MessageDatabase.SearchMessages(search); 

14 } 

15 } 

MessageDatabase supports a limited number of concurrent executions of its methods. 

You need to change the service to allow up to the maximum number of executions of the methods of MessageDatabase. This should be implemented without preventing customers from connecting to the service. 

What should you do? 

A. Change the service behavior as follows. [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple, InstanceContextMode = InstanceContextMode.Single)] 

B. Change the service behavior as follows. [ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Single, InstanceContextMode = InstanceContextMode.PerSession)] 

C. Add a throttling behavior to the service, and configure the maxConcurrentCalls. 

D. Add a throttling behavior to the service, and configure the maxConcurrentSessions. 

Answer:


Question No. 6

You are developing a Windows Communication Foundation (WCF) service that is used to check the status of orders placed by customers. The following code segment is part of your service. (Line numbers are included for reference only.) 


A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:


Question No. 7

You are debugging a Windows Communication Foundation (WCF) service. The service uses signed and encrypted messages. 

You need to configure logging so that you can read the contents of the messages. 

What should you do? 

A. Set maxSizeMessagesToLog to 10 

B. Set logMessageAtServiceLevel to true. 

C. Set maxMessagesToLog to 10. 

D. Set logMessageAtTransportLevel to true. 

Answer:


Question No. 8

DRAG DROP 

You create a Windows Communication Foundation (WCF) service. 

The service must be multi-threaded and maintain state across threads. 

You need to create the code for the service. 

Which code segments should you use? (To answer, drag the appropriate code segments to the correct location or locations in the answer area. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.) 


Answer: 


Question No. 9

You are developing a Windows Communication Foundation (WCF) service that must be discoverable. 

You need to ensure that the ServiceHost instance supports multiple discovery versions. 

What should you do? 

A. Specify a unique DiscoveryVersion parameter for each endpoint constructor. 

Use the same value for the Address property of each endpoint. 

B. Use the endpoint constructor without the DiscoveryVersion parameter. 

Use a unique value for the Address property of each endpoint. 

C. Specify a unique DiscoveryVersion parameter for each endpoint constructor. 

Use a unique value for the Address property of each endpoint. 

D. Use the endpoint constructor without the DiscoveryVersion parameter. 

Use the same value for the Address property of each endpoint. 

Answer:


Question No. 10

A Windows Communication Foundation (WCF) application uses the following data contract. 


Which code segment should you use? 

A. <DataMember()> 

Public firstName As String 

<DataMember()> 

Public lastName As String 

<DataMember(EmitDefaultValue:=True)> 

Public age As Integer = 0 <DataMember(EmitDefaultValue:=True)> Public ID As Integer = 999999999 

B. <DataMember(EmitDefaultValue:=False)> 

Public firstName As String = Nothing 

<DataMember(EmitDefaultValue:=False)> 

Public lastName As String = Nothing 

<DataMember(EmitDefaultValue:=True)> 

Public age As Integer = -1 

<DataMember(EmitDefaultValue:=False)> 

Public ID As Integer = 999999999 

C. <DataMember(EmitDefaultValue:=True)> 

Public firstName As String 

<DataMember(EmitDefaultValue:=True)> 

Public lastName As String 

<DataMember 

(EmitDefaultValue:=False)> 

Public age As Integer = -1 

<DataMember(EmitDefaultValue:=False)> 

Public ID As Integer = 999999999 

D. <DataMember()> 

Public firstName As String = Nothing 

<DataMember()> 

Public lastName As String = Nothing 

<DataMember(EmitDefaultValue:=False)> 

Public age As Integer = 0 

< DataMember(EmitDefaultValue:=False)> 

Public ID As Integer = 999999999 

Answer:


Question No. 11

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:


Question No. 12

You are developing a Windows Communication Foundation (WCF) service. You establish that the largest size of valid messages is 8,000 bytes. You notice that many malformed messages are being transmitted. 

Detailed information about whether each message is malformed must be logged. 

You need to ensure that this information is saved in XML format so that it can be easily analyzed. 

What should you add to the service configuration file? 

A. <messageLogging logMessagesAtServiceLevel="true" logMessagesAtTransportLevels"true" maxMessagesToLog="1000" maxSizeOfMessageToLog="8000"/> 

B. <roessageLogging logEntireMessage="true" logNalformedMessages="false" logMessagesAtServiceLeve1="true" logMessagesAtTransportLevel="true" maxMessagesToLog""1000"/> 

C. <message Logging logEntireMessage="true" logHalformedMessages""false" logMessagesAtServiceLevel-"true" logMessagesAtTransportLevel-"true" maxMessagesToLog="1000" maxSizeOfMessageToLog="8000"/> 

D. <messageLogging logEnt ireMessage="true" logHalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTranspoctLevel="true" maxMessagesToLog="1000" maxSizeOfMessageToLog="100000"/> 

Answer:


Question No. 13

You are developing an application to update a users social status. You need to consume the service using Windows Communication Foundation (WCF). 

The client configuration is as follows. 

<system.serviceModel> 

<bindings> 

<webHttpBinding> 

<binding name="SocialConfig"> 

<security mode="TransportCredentialOnly"> 

<transport clientCredentialType="Basic" 

realm="Social API" /> 

</security> 

</binding> 

</webHttpBinding> 

</bindings> 

<client> 

<endpoint address= " http:// contoso .com " 

binding="webHttpBinding" 

bindingConfiguration="SocialConfig" 

ontract="ISocialStatus" 

name="SocialClient" /> 

</client> 

</system.serviceModel> 

The service contract is defined as follows. 

<ServiceContract()> 

Public Interface ISocialStatus 

<OperationContract()> 

<WebInvoke(UriTemplate:="/statuses/update.xml?status={text}")> 

Sub UpdateStatus(ByVal text As String) 

End Interface 

Which code segment should you use to update the social status? 

A. Using factory As WebChannelFactory(Of ISocialStatus) = 

New WebChannelFactory(Of ISocialStatus)("SocialClient") 

factory.Credentials.UserName.UserName = user.Name 

factory.Credentials.UserName.Password = user.Password 

Dim socialChannel As ISocialStatus = 

factory.CreateChannel() 

socialChannel.UpdateStatus(newStatus) 

End Using 

B. Using factory As ChannelFactory(Of ISocialStatus) = 

New WebChannelFactory(Of ISocialStatus)(GetType(ISocialStatus)) 

factory.Credentials.UserName.UserName = user.Name 

factory.Credentials.UserName.Password = user.Password 

Dim socialChannel As ISocialStatus = 

factory.CreateChannel() socialChannel.UpdateStatus(newStatus) End Using 

C. Using factory As ChannelFactory(Of ISocialStatus) = 

New ChannelFactory(Of ISocialStatus)("POST") 

factory.Credentials.Windows.ClientCredential.UserName = 

user.Name 

factory.Credentials.Windows.ClientCredential.SecurePassword.SetAt( 

0, user.Password) 

Dim socialChannel As ISocialStatus = factory.CreateChannel() 

socialChannel.UpdateStatus(newStatus) 

End Using 

D. Using factory As WebChannelFactory(Of ISocialStatus) = 

New WebChannelFactory(Of ISocialStatus)(GetType(ISocialClient)) 

factory.Credentials.Windows.ClientCredential.UserName = 

user.Name 

factory.Credentials.Windows.ClientCredential.SecurePassword.SetAt( 

0, user.Password) 

Dim socialChannel As ISocialStatus = factory.CreateChannel() 

socialChannel.UpdateStatus(newStatus) 

End Using 

Answer:


Question No. 14

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(GetType(Exception))> 

Answer:


Question No. 15

You are developing a Windows Communication Foundation (WCF) service that is used to check the status of orders placed by customers. The following code segment is part of your service. (Line numbers are included for reference only.) 

[MISSING]

You need to ensure that the service always listens at net.pipe://SupplyChainServer/Pipe. What should you do? 


A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer: