You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The application consumes a Microsoft Windows Communication Foundation (WCF) service.
The WCF service exposes the following method.
[WebInvoke] string UpdateCustomerDetails(string custID);
The application hosts the WCF service by using the following code segment.
Dim host As New WebServiceHost(GetType(CService), New Uri("http://win/"))
Dim ep As ServiceEndpoint = host.AddServiceEndpoint(GetType(ICService), New WebHttpBinding(), "")
You need to invoke the UpdateCustomerDetails method.
Which code segment should you use?
A.
Dim wcf As New WebChannelFactory(Of ICService)(New Uri("http: //win"))
Dim channel As ICService = wcf.CreateChannel()
Dim s As String = channel.UpdateCustomerDetails("CustID12")
B.
Dim wcf As New WebChannelFactory(Of ICService)(New Uri("http://win/UpdateCustomerDetails"))
Dim channel As ICService = wcf.CreateChannel()
Dim s As String = channel.UpdateCustomerDetails("CustID12")
C.
Dim cf As New ChannelFactory(Of ICService)(New WebHttpBinding(), "http: //win/UpdateCustomerDetails")
Dim channel As ICService = cf.CreateChannel()
Dim s As String = channel.UpdateCustomerDetails("CustID12")
D.
Dim cf As New ChannelFactory(Of ICService)(New BasicHttpBinding(), "http: //win ")
cf.Endpoint.Behaviors.Add(New WebHttpBehavior())
Dim channel As ICService = cf.CreateChannel()
Dim s As String = channel.UpdateCustomerDetails("CustID12")