Microsoft
70-513 · Question #327
70-513 Question #327: Real Exam Question with Answer & Explanation
Sign in or unlock 70-513 to reveal the answer and full explanation for question #327. The question stem and answer options stay visible for context.
Question
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 Which code segment should you use?
Options
- AWebServiceHost svcHost = new WebServiceHost(typeof(HelloService));
- CWebServiceHost svcHost = new WebServiceHost(new HelloService());
Unlock 70-513 to see the answer
You've previewed enough free 70-513 questions. Unlock 70-513 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.