Which code segment should you use?

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. Dim client As TravelServiceClient = New
TravelServiceClient() 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 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. Dim client As TravelServiceClient = New
TravelServiceClient() You need to ensure that a callback is received when the GetFlight
operation is called asynchronously. Which code segment should you use?

A.
client.BeginGetFlight(AddressOf GetFlightCallback, Nothing) client.GetFlight()

B.
Dim asyncResult As IAsyncResult = client.BeginGetFlight( AddressOf GetFlightCallback,
client) client.EndGetFlight(asyncResult)

C.
AddHandler client.GetFlightCompleted, New EventHandler(Of
GetFlightCompletedEventArgs) (AddressOf GetFlightCallback) client.GetFlightAsync()

D.
client.GetFlight() client.BeginGetFlight(AddressOf GetFlightCallback, Nothing)

Explanation:



Leave a Reply 0

Your email address will not be published. Required fields are marked *