ServiceDescription.Endpoints Proprietà
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Ottiene la raccolta di endpoint dalla descrizione del servizio.
public:
property System::ServiceModel::Description::ServiceEndpointCollection ^ Endpoints { System::ServiceModel::Description::ServiceEndpointCollection ^ get(); };
public System.ServiceModel.Description.ServiceEndpointCollection Endpoints { get; }
member this.Endpoints : System.ServiceModel.Description.ServiceEndpointCollection
Public ReadOnly Property Endpoints As ServiceEndpointCollection
Valore della proprietà
Oggetto ServiceEndpointCollection contenente gli endpoint definiti per il servizio.
Esempio
// Iterate through the endpoints contained in the ServiceDescription
ServiceEndpointCollection sec = svcDesc.Endpoints;
foreach (ServiceEndpoint se in sec)
{
Console.WriteLine("Endpoint:");
Console.WriteLine("\tAddress: {0}", se.Address.ToString());
Console.WriteLine("\tBinding: {0}", se.Binding.ToString());
Console.WriteLine("\tContract: {0}", se.Contract.ToString());
KeyedByTypeCollection<IEndpointBehavior> behaviors = se.Behaviors;
foreach (IEndpointBehavior behavior in behaviors)
{
Console.WriteLine("Behavior: {0}", behavior.ToString());
}
}
' Iterate through the endpoints contained in the ServiceDescription
Dim sec As ServiceEndpointCollection = svcDesc.Endpoints
For Each se As ServiceEndpoint In sec
Console.WriteLine("Endpoint:")
Console.WriteLine(Constants.vbTab & "Address: {0}", se.Address.ToString())
Console.WriteLine(Constants.vbTab & "Binding: {0}", se.Binding.ToString())
Console.WriteLine(Constants.vbTab & "Contract: {0}", se.Contract.ToString())
Dim behaviors As KeyedByTypeCollection(Of IEndpointBehavior) = se.Behaviors
For Each behavior As IEndpointBehavior In behaviors
Console.WriteLine("Behavior: {0}", CType(behavior, Object).ToString())
Next behavior
Next se
Commenti
Gli endpoint nell'oggetto ServiceEndpointCollection restituito da questo metodo contengono l'indirizzo, l'associazione, il contratto e le informazioni sul comportamento necessarie per comunicare con il servizio. Per accedere a queste informazioni, è necessario recuperare l'oggetto ServiceEndpoint dalla raccolta con il Find metodo che utilizza i criteri di ricerca pertinenti. È quindi possibile usare le ServiceEndpoint proprietà per accedere alle informazioni. Ad esempio, l'oggetto ContractDescription è accessibile dalla Contract proprietà .
Esportare i metadati relativi a un endpoint di servizio passando ServiceEndpoint come parametro a ExportEndpoint(ServiceEndpoint).