Export (0) Print
Expand All

BasicHttpBinding Constructor

Initializes a new instance of the BasicHttpBinding class.

Namespace:  System.ServiceModel
Assemblies:   System.ServiceModel.Http (in System.ServiceModel.Http.dll)
  System.ServiceModel (in System.ServiceModel.dll)

Public Sub New

The default value of BasicHttpSecurityMode used is None, which specifies that the SOAP message is not secured and the client is not authenticated.

Dim binding As BasicHttpBinding = New BasicHttpBinding()
binding.Name = "binding1"
binding.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard
binding.Security.Mode = BasicHttpSecurityMode.None

Dim baseAddress As Uri = New Uri("http://localhost:8000/servicemodelsamples/service")
Dim address As Uri = New Uri("http://localhost:8000/servicemodelsamples/service/calc")

' Create a ServiceHost for the CalculatorService type and provide the base address. 
Using serviceHost As ServiceHost = New ServiceHost(GetType(CalculatorService), baseAddress)

    serviceHost.AddServiceEndpoint(GetType(ICalculator), binding, address)

    ' Open the ServiceHost to create listeners and start listening for messages.

    ' The service can now be accessed.
    Console.WriteLine("The service is ready.")
    Console.WriteLine("Press <ENTER> to terminate service.")

    ' Close the ServiceHost to shutdown the service.
End Using

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8
© 2015 Microsoft