Export (0) Print
Expand All

ServiceEndpoint Constructor (ContractDescription, Binding, EndpointAddress)

Initializes a new instance of the ServiceEndpoint class with a specified contract, binding, and address.

Namespace:  System.ServiceModel.Description
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public ServiceEndpoint(
	ContractDescription contract,
	Binding binding,
	EndpointAddress address
)

Parameters

contract
Type: System.ServiceModel.Description.ContractDescription

The ContractDescription for the service endpoint.

binding
Type: System.ServiceModel.Channels.Binding

The Binding that specifies how the service endpoint communicates with the world.

address
Type: System.ServiceModel.EndpointAddress

The EndpointAddress for the service endpoint.

Use this constructor to specify a service endpoint imperatively in code.

string address = "http://localhost:8001/CalculatorService";

ServiceEndpoint endpoint = new ServiceEndpoint(
    ContractDescription.GetContract(
        typeof(ICalculator), 
        typeof(CalculatorService)), 
        new WSHttpBinding(), 
        new EndpointAddress(address));

.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
Show:
© 2015 Microsoft