试题详情
单项选择题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
  • 关注下方微信公众号,在线模考后查看

热门试题