Adds a service endpoint to the hosted service with a specified contract, binding, and endpoint address.
Espace de noms: System.ServiceModel
Assembly : System.ServiceModel (dans system.servicemodel.dll)
Visual Basic (Déclaration)
Public Function AddServiceEndpoint ( _
implementedContract As String, _
binding As Binding, _
address As String _
) As ServiceEndpoint
Visual Basic (Utilisation)
Dim instance As ServiceHostBase
Dim implementedContract As String
Dim binding As Binding
Dim address As String
Dim returnValue As ServiceEndpoint
returnValue = instance.AddServiceEndpoint(implementedContract, binding, address)
public ServiceEndpoint AddServiceEndpoint (
string implementedContract,
Binding binding,
string address
)
public:
ServiceEndpoint^ AddServiceEndpoint (
String^ implementedContract,
Binding^ binding,
String^ address
)
public ServiceEndpoint AddServiceEndpoint (
String implementedContract,
Binding binding,
String address
)
public function AddServiceEndpoint (
implementedContract : String,
binding : Binding,
address : String
) : ServiceEndpoint
Paramètres
- implementedContract
The contract implemented by the endpoint.
- binding
The Binding for the endpoint added.
- address
The String that contains the address for the endpoint added. This could be an absolute or relative URI. If it is a relative URI, one of the base address of the ServiceHost (depending on the binding protocol) is used as the endpoint's base address.
Valeur de retour
The ServiceEndpoint added to the hosted service.
| Type d'exception | Condition |
|---|
ArgumentNullException | implementedContract or binding or address or is référence Null (Nothing en Visual Basic). |
>InvalidOperatorException | 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 or the binding lacks a transport of binding scheme. |
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile pour Pocket PC, Windows Mobile pour Smartphone, Windows Server 2003, Windows XP Édition Media Center, Windows XP Professionnel Édition x64, Windows XP SP2, Windows XP Starter Edition
Microsoft .NET Framework 3.0 est pris en charge sur Windows Vista, Microsoft Windows XP SP2 et Windows Server 2003 SP1.
.NET Framework
Prise en charge dans : 3.0