AddServiceEndpoint Method (String, Binding, Uri)

ServiceHostBase.AddServiceEndpoint Method (String, Binding, Uri)

Adds a service endpoint to the hosted service with a specified contract, binding, and a URI that contains the endpoint address.

Namespace: System.ServiceModel
Assembly: System.ServiceModel (in system.servicemodel.dll)

public ServiceEndpoint AddServiceEndpoint (
	string implementedContract,
	Binding binding,
	Uri address
public ServiceEndpoint AddServiceEndpoint (
	String implementedContract, 
	Binding binding, 
	Uri address
public function AddServiceEndpoint (
	implementedContract : String, 
	binding : Binding, 
	address : Uri
) : ServiceEndpoint
Not applicable.



The contract implemented by the endpoint.


The Binding for the endpoint added.


The Uri that contains the address for the endpoint added.

Return Value

The ServiceEndpoint added to the hosted service.

Exception typeCondition


implementedContract or binding or address or is a null reference (Nothing in Visual Basic).


The host is not in a Created or an Opening state or there is no ServiceDescription for the hosted service and so an endpoint cannot be added.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

© 2016 Microsoft