PrepAway - Latest Free Exam Questions & Answers

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?

PrepAway - Latest Free Exam Questions & Answers

A.
var channelFactory = new ChannelFactory<ITaxService>( myBinding);

B.
var channelFactory = new ChannelFactory<ITaxService>( myBinding,
myEndpointAddress);

C.
var channelFactory = new ChannelFactory<ITaxService>(
“http://contoso.com/TaxService.svc”);

D.
var channelFactory = new ChannelFactory<ITaxService>();


Leave a Reply