Which code segment should you insert at line 03?
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?
[WebInvoke(UriTemplate = "/statuses/update.xml?
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.
<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”
contract=”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}”)]
void UpdateStatus(string text);
}
Which code segment should you use to update the social status?
What should you do?
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?
Which binding elements should you use?
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?
Which two action should you perform?
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 string Login(int employeeID, string passwordHash);
06
07 [OperationContract]
08 double GetBonus(int month);
09
10 [OperationContract(IsTerminating = true)]
11 void Logout();
12 }
Client application 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 action should you perform? (Each correct answer presents part of the solution. Choose two.)
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?
What should you do?
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?
Which performance counter should you monitor?
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 to each user. You need to monitor the instancing behaviour used in the service.
Which performance counter should you monitor?
What do you do?
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 endpoint behaviour. 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 do you do?
What should you do?
You are hosting a Windows Communication Foundation (WCF) service at http://www.contoso.com for a law enforcement agency.
The agency adds operations to support sending biometric fingerprint data via non-buffered streaming.
The service data is routed between intermediaries. The WCF binding you are using by default does not support encryption.
You need to ensure that the fingerprint data is not disclosed when passed over the network. What should you do?