You are developing a Windows Communication Foundation (WCF) service that allows customers to update
financial data.
The service contract is defined as follows. (Line numbers are included for reference only)
01 [ServiceContract]
02 public interface IDataUpdate
03 {
04 [OperationContract]
05 [TransactionFlow(TransactionFlowOption.Mandatory)]
06 void Update(string accountNumber, double amount);
07 }
08
09 class UpdateService : IDataUpdate
10 {
11 [OperationBehavior(TransactionScopeRequired = true,
TransactionAutoComplete = false)]
12 public void Update(string accountNumber, double amount)
13 {
14 ...
15 }
16 }
17
You need to ensure that the service is invoked within the transaction. What should you do?
You are developing a Windows Communication Foundation (WCF) service that is hosted by a Windows
Forms Application.
The ServiceHost instance is created in the Form Constructor.
You need to ensure that the service is not blocked while the UI thread is busy. What should you do?
You develop a Windows Communication Foundation (WCF) service that interacts with Microsoft Message
Queuing (MSMQ). The service requires sessions.
You need to create a custom binding that enables messages sent to the queue to be viewed when you are
using a listener tool.
Which binding elements should you use?
You are creating a Windows Communication Foundation (WCF) service. The service endpoints change
frequently.
On the service, you add a new ServiceDiscoveryBehavior to the Behaviors collection of the ServiceHost
Description property.
You need to ensure that client applications can communicate with the service and discover changes to the
service endpoints.
What should you do?
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 follow.
The service contract is defined as follows.
[ServiceContract]
public interface ISocialStatus
{
[OperationContract]
[WebInvoke(UriTemplate = "/statuses/update.xml?status={text}")]
void UpdateStatus(string text);
}
Which code segment should you use to update the social status?
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 BasicHttpBinding myBinding = new BasicHttpBinding();
02 EndpointAddress myEndpointAddress = new EndpointAddress("http://contoso.com/
TaxService.svc");
03 ...
04 ITaxService client = channelFactory.CreateChannel();
05 string data = client.GetData(1);
You need to consume the service. Which code segment should you insert at line 03?
You are developing a client application that consumes a Windows Communication Foundation (WCF)
service.
You use the svcutil.exe utility to create a proxy for the service. You use the svcutil.exe switches that
generate asynchronous calls.
GetFlight is a service operation that takes no parameters and returns a string.
The GetFlightCallback method must be called when the service operation returns.
You create an instance of the client proxy with the following code:
var client = new TranvelServiceClient();
You need to ensure that a callback is received when the GetFlight operation is called asynchronously.
Which code segment should you use?
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?
Your company has a Windows Communication Foundation (WCF) service at the URL http://
services.contoso.com/OrderLookupService.svc.
The section of the configuration file is as follows. (Line numbers are included for
reference only.)
01
02
03
04
05
06 ...
07
08
09
10
11
You need to ensure that the service publishes the WSDL description at http://services.contoso.com/
OrderLookupService.svc?wsdl.
What should you do?
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?