多做题,通过考试没问题!

微软认证考试

睦霖题库>其他计算机考试>微软认证考试

A Windows Communication Foundation (WCF) service implements the following contract. [ServiceContract] public interface IHelloService { [OperationContract(WebGet(UriTemplate="hello?name={name}"))] string SayHello(string name);}The implementation is as follows:public class HelloService: IHelloService { public string SayHello(string name) { return "Hello " + name; }}The service is self-hosted, and the hosting code is as follows:WebServiceHost svcHost = CreateHost( );svcHost.Open( );Console.ReadLine( );svcHost.Close( );You need to implement CreateHost so that the service has a single endpoint hosted at http://localhost:8000/HelloService.Which code segment should you use?()

  • A、
  • B、
  • C、
  • D、
正确答案:B
答案解析:
进入题库查看解析

微信扫一扫手机做题