nerdexam
Microsoft

70-513 · Question #98

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…

The correct answer is C. var channelFactory = new ChannelFactory<ITaxService>(. See the full explanation below for the reasoning.

Question

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 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?

Options

  • Avar channelFactory = new ChannelFactory<ITaxService>();
  • Bvar channelFactory = new ChannelFactory<ITaxService>(myBinding);
  • Cvar channelFactory = new ChannelFactory<ITaxService>(
  • Dvar channelFactory = new ChannelFactory<ITaxService>(

How the community answered

(23 responses)
  • A
    4% (1)
  • B
    13% (3)
  • C
    78% (18)
  • D
    4% (1)

Community Discussion

No community discussion yet for this question.

Full 70-513 Practice