WebServiceBindingAttribute.Name 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定繫結的名稱。
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
屬性值
繫結的名稱。 預設為附有 SOAP 的 XML Web Service 名稱。
範例
下列範例會指定名為 LocalBinding
的系結,該系結定義于 XML Web 服務中 BindingSample
。
<%@ 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>