Microsoft TS: Windows Communication Foundation velopment with Microsoft .NET Framework 4 Sample Questions:
1. 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 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)]
2. You are developing a Windows Service. The Windows Service will host a Windows Communication Foundation (WCF) service.
The Windows Service class will inherit from ServiceBase.
You need to ensure that the WCF service starts when the Windows Service is restarted.
What should you do in the Windows Service class?
A) Override the OnStart method and create and open a new ServiceHost.
Override the OnStop method and close the ServiceHost.
B) Override the OnPowerEvent method and open a new ServiceHost.
Override the OnShutdown method and close the ServiceHost.
C) Override the OnContinue method and open a new ServiceHost.
Override the OnStop method and close the ServiceHost.
D) Create a public method named Main.
Create a new ServiceHost in the Main method.
Override the OnShutdown method and close the ServiceHost.
3. You are creating a Window s Communication Foundation (WCF) service application. The
application needs to service many clients and requests simultaneously. The application also needs to ensure subsequent individual client requests provide a stateful conversation.
You need to configure the service to support these requirements.
Which attribute should you add to the class that is implementing the service?
A) [ ServiceBehavior ( InstanceContextMode =
InstanceContextMode.PerCall,
ConcurrencyMode = ConcurrencyMode.Multiple )]
B) [ ServiceBehavior ( InstanceContextMode =
InstanceContextMode.PerCall,
ConcurrencyMode = ConcurrencyMode.Reentrant )]
C) [ ServiceBehavior ( InstanceContextMode =
InstanceContextMode.PerSession,
ConcurrencyMode = ConcurrencyMode.Multiple )]
D) [ ServiceBehavior ( InstanceContextMode =
InstanceContextMode.PerSession,
ConcurrencyMode = ConcurrencyMode.Single )]
4. A Windows Communication Foundation (WCF) solution uses the following contract.
<ServiceContract(SessionMode:=SessionMode Allowed)s Public Interface lMyService <OperationContract(lsTerminating:sFalse)s Sub Initialize () <OperationContract(lslnitiating:sFalse)>s Sub DoSomething() <OperationContract(lsterminating:=True)>
Sub Terminate ()
End Interface You need to change this interface so that:
"Initialize is allowed to be called at any time before Terminate is called.
"DoSomething is allowed to be called only after Initialize is called, and not allowed to be called after Terminate is called. "Terminate will be allowed to be called only after Initialize is called
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
A) Change the ServiceContract attribute of the lMyService interface to the following. ServiceContract(SessionMode:sSessionMode. Required)
B) Change the OperationContract attribute of the Initialize operation to the following. OperationContract(lslnitiating: 'True, IsTerminating: 'False)
C) Change the ServiceContract attribute of the lMyService interface to the following. ServiceContract(SessionMode:sSessionModeAllowed)?
D) Change the OperationContract attribute of the Terminate operation to the following. OperationContract(Islnitiatings:False, lsTerminating: 'True)
5. You are developing a Windows Communication Foundation (WCF) service that allows customers to update financial data.
The client applications call the service in a transaction. The service contract is defined as follows. (Line numbers are included for reference only.)
Customers report that the transaction completes successfully even if the Update method throws an exception.
You need to ensure that the transaction is aborted if the Update method is not successful.
What should you do?
A) Insert the following line at line 09. [ServiceBehavior( TransactionAutoCompleteOnSessionClose = false)]
B) Replace line 12 with the following line. [OperationBehavior( TransactionScopeRequired = true, TransactionAutoCoroplete - false)]
C) Insert the following line at line 09. [ServiceBehavior( TransactionAutoCompleteOnSessionClose = true)]
D) insert the following line at line 22. throw;
Solutions:
| Question # 1 Answer: C,D | Question # 2 Answer: A | Question # 3 Answer: C | Question # 4 Answer: A,D | Question # 5 Answer: D |


PDF Version Demo






We are confident about the products and aim to help you pass with ease. In case of failure, we will provide a no hassle full money back guarantee for the purchasing fee.
768 Customer Reviews
Quality and ValueITbraindumps Practice Exams are written to the highest standards of technical accuracy, using only certified subject matter experts and published authors for development - no all study materials.
Tested and ApprovedWe are committed to the process of vendor and third party approvals. We believe professionals and executives alike deserve the confidence of quality coverage these authorizations provide.
Easy to PassIf you prepare for the exams using our ITbraindumps testing engine, It is easy to succeed for all certifications in the first attempt. You don't have to deal with all dumps or any free torrent / rapidshare all stuff.
Try Before BuyITbraindumps offers free demo of each product. You can check out the interface, question quality and usability of our practice exams before you decide to buy.