PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

What are two possible ways to achieve this goal?

A Windows Communication Foundation (WCF) solution uses the following contracts. (Line
numbers are included for reference only.) 01 [ServiceContract(CallbackContract =
typeof(INameService))] 02 public interface IGreetingService 03 { 04 [OperationContract] 05
string GetMessage(); 06 } 07 08 [ServiceContract] 09 public interface INameService 10 { 11
[OperationContract] 12 string GetName(); 13 } When the client calls GetMessage on the
service interface, the service calls GetName on the client callback. In the client, the class
NameService implements the callback contract. The client channel is created as follows. 22
In stanceContext callbackContext = new InstanceContext(new NameService(“client”)); 25
DuplexChannelFactory<IGreetingService> factory = new
DuplexChannelFactory<IGreetingService>( typeof(NameService), binding, address); 26
IGreetingService greetingService = factory.CreateChannel(); You need to ensure that the
service callback is processed by the instance of NameService. What are two possible ways
to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

Which two actions should you perform?

You use the following declaration to add a Web user control named TestUserControl.ascx to an
ASP.NET page named TestPage.aspx.
<uc:TestUserControl ID=”testControl” runat=”server”/>
You add the following code to the code-behind file of TestPage.aspx.
Private Sub TestMethod()
End Sub
You define the following delegate.
Public Delegate Sub MyEventHandler()
You need to add an event of type MyEventHandler named MyEvent to TestUserControl.ascx and
attach the pages TestMethod method to the event. Which two actions should you perform? (Each
correct answer presents part of the solution. Choose two.)