Which code segment should you use in this class?
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?
You need to ensure that other services are notified when the service is started
You have an existing Windows Communication Foundation (WCF) service. You need to
ensure that other services are notified when the service is started. What should you do?
Which code segment should you use?
You are creating a Windows Communication Foundation (WCF) service. You do not want to
expose the internal implementation at the service layer. You need to expose the following
class as a service named Arithmetic with an operation named Sum. public class Calculator {
public int Add(int x, int y) { } } Which code segment should you use?
What should you do?
You are creating a Windows Communication Foundation (WCF) service that responds using
plainold XML (POX). You have the following requirements: You must enable the
/catalog.svc/items operation to respond using the POX, JSON, or ATOM formats. You also
must ensure that the same URL is used regardless of the result type. You must determine
the response format by using the Accepts HTTP header. What should you do?
How should you define the service and endpoint tags?
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?
Which URI should you specify in the endpoint configuration settings of the service?
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?
Which line of code should you insert at line 04?
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; 04 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?
Which XML segment should you add to the system.serviceModel configuration section of the web.config file?
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?
Which binding should you use?
You are creating a Windows Communication Foundation (WCF) service. You need to
ensure that the service is compatible with ASP.NET to make use of the session state.
Which binding should you use?
Which two actions should you perform?
You are adding a Windows Communication Foundation (WCF) service to an existing
application. The application is configured as follows. (Line numbers are included for
reference only.) 01 <configuration> 02 < system.serviceModel > 03 <services> 04 <service
name=” Contoso.Sales.StockService ” 05 behaviorConfiguration =” MetadataBehavior ” >
06 <host> 07 < baseAddresses > 08 <add baseAddress
=”http://contoso.com:8080/StockService” /> 09 </ baseAddresses > 10 </host> 11
</service> 12 </services> 13 <behaviors> 14 < serviceBehaviors > 15 <behavior name=”
MetadataBehavior “> 16 </behavior> 17 </ serviceBehaviors > 18 </behaviors> … You need
to configure the service to publish the service metadata. Which two actions should you
perform? (Each correct answer presents part of the solution. Choose two.)