70-513 · Question #158
A Windows Communication Foundation (WCF) service implements the following cortract. <ServiceContract0>? Public Interface lHeloServic e <operationContractQ> <WebGet(UriTempbte: ="helloname={name}")s…
The correct answer is B. Dim baseAddress As Ur New Uri("http:/i1ocahost:8000r). See the full explanation below for the reasoning.
Question
A Windows Communication Foundation (WCF) service implements the following cortract. <ServiceContract0>? Public Interface lHeloServic e <operationContractQ> <WebGet(UriTempbte: ="helloname={name}")s Function SayHello(Byval name As String) As nng End Interface The implementation is as follows Public Class HelloService Implements IHelloService Public Function SayHello(ByVal name As String) As String - Implements lHelloServiceSayHello Retumn "Hello "& name End Function End Cesst The service is self-hosted, and the hosting code is as follows. Dim stHost As WebServiceHo = CreateHost() svcHo Open() Consde ReadLine() svcHoaClose() You need to implement CreateHost so that the service has a single endpoint hosted Which code segment should you use?
Options
- ADim svc Host As WebSennceHost = New WebServiceHost(GetType(HdloService))
- BDim baseAddress As Ur New Uri("http:/i1ocahost:8000r)
- CDim svc Host As WebServiceHost = New WebServiceHost(New HelloSennceO)
- DDim baseAddress As Ur = New Uri("http/I1ocahost 8OOOP
How the community answered
(59 responses)- A3% (2)
- B71% (42)
- C10% (6)
- D15% (9)
Community Discussion
No community discussion yet for this question.