WebServiceBindingAttribute.Location 속성

정의

바인딩이 정의된 위치를 가져오거나 설정합니다.

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

속성 값

String

바인딩이 정의된 위치이며 기본값은 특성이 적용된 XML Web services의 URL입니다.

예제

다음 예제에서는 명명 된 바인딩을 지정 RemoteBinding 의 멤버인 합니다 http://www.contoso.com/MyBinding 네임 스페이스에 정의 된 http://www.contoso.com/MyService.asmx?wsdl합니다.

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

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

// Binding is defined on a remote server, but this XML Web service 
// implements at least one operation in that binding.
[ WebServiceBinding(Name="RemoteBinding",
    Namespace="http://www.contoso.com/MyBinding",
    Location="http://www.contoso.com/MyService.asmx?wsdl")]
public class BindingSample  
{
    [ SoapDocumentMethod(Binding="RemoteBinding")] 
    [ WebMethod() ]
    public string RemoteBindingMethod() 
    {
        return "Member of a binding defined on another server";
    }
}
<%@ WebService language="VB" class="BindingSample" %>

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

' <Snippet1>
' Binding is defined on a remote server, but this XML Web service implements at
' least one operation in that binding.
<WebServiceBinding(Name := "RemoteBinding", _
    Namespace := "http://www.contoso.com/MyBinding", _
    Location := "http://www.contoso.com/MyService.asmx?wsdl")> _
Public Class BindingSample
        
    <SoapDocumentMethod(Binding := "RemoteBinding"), WebMethod()> _
    Public Function RemoteBindingMethod() As String
        Return "Member of a binding defined on another server"
    End Function
End Class

' </Snippet1>

적용 대상

추가 정보