WebServiceBindingAttribute.Name Właściwość

Definicja

Pobiera lub ustawia nazwę powiązania.

public:
 property System::String ^ Name { System::String ^ get(); void set(System::String ^ value); };
public string Name { get; set; }
member this.Name : string with get, set
Public Property Name As String

Wartość właściwości

String

Nazwa powiązania. Wartość domyślna to nazwa usługi sieci Web XML z dołączonym ciągiem "Soap".

Przykłady

W poniższym przykładzie określono powiązanie o nazwie LocalBinding zdefiniowane w usłudze BindingSample sieci Web XML.

<%@ WebService Language="C#" class="BindingSample" %>

using System;
using System.Web.Services;
using System.Web.Services.Protocols;

// Binding is defined in this XML Web service and uses the default namespace.
 [ WebServiceBinding(Name="LocalBinding")]
 public class BindingSample  {

      [ SoapDocumentMethod(Binding="LocalBinding")]
      [ WebMethod() ]
      public string LocalBindingMethod() {
               return "Member of binding defined in this XML Web service and member of the default namespace";
      }

 }
<%@ WebService Language="VB" class="BindingSample" %>

Imports System
Imports System.Web.Services
Imports System.Web.Services.Protocols

' <Snippet1>
' Binding is defined in this XML Web service and uses the default namespace.
<WebServiceBinding(Name := "LocalBinding")> _
Public Class BindingSample    
    
    <SoapDocumentMethod(Binding := "LocalBinding"), WebMethod()> _
    Public Function LocalBindingMethod() As String
    
        Return "Member of binding defined in this XML Web service and member of the default namespace"
    End Function 'LocalBindingMethod
    
End Class
   
' </Snippet1>

Dotyczy