<ServiceContract0>?

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
http:/Ilocalhost8000/HeloService. Which code segment should you use?

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
http:/Ilocalhost8000/HeloService. Which code segment should you use?

A.
Dim baseAddress As Ur = New Uri(“http/I1ocahost 8OOOP Dim svcHo As
WebServiceHost = New WebServiceHost(New HelloService0, baseAddress) svc
HostAddServiceEndpoint(GdType(IHelIoService), New
WebHttpBinding(WebHttpSecuntyMode None), “HelloService”) Return svc Host

B.
Dim svc Host As WebSennceHost = New WebServiceHost(GetType(HdloService)) svc
HotsAddServiceEndpoint(GdType(lHelloService), New
WebHttpBinding(WebHttpSecurityModeNone), “http:/Ibc alhost 8000!HelloService”) Return
svc Host

C.
Dim baseAddress As Ur New Uri(”http:/i1ocahost:8000r) Dim svcHo As WebServiceHost
= New WebServiceHost(GetType(HelloService), baseAddress) svc
Host.AddServiceEndpoint(GdType(lHelloService),? New Web Http Binding (WebHttpSec
urityMode None), HelloService) Return svc Host

D.
Dim svc Host As WebServiceHost = New WebServiceHost(New HelloSennceO)
svcHost.AddServiceEndpoint(GetType(IHelloService), New
WebHttpBinding(WebHttpSecurityModeNone), Thttp://bc aihost: 8000/HelloSennce”) Return
svc Host



Leave a Reply 0

Your email address will not be published. Required fields are marked *