次の方法で共有


WebServiceBindingAttribute.Location プロパティ

バインディングが定義されている場所を取得または設定します。

Public Property Location As String
[C#]
public string Location {get; set;}
[C++]
public: __property String* get_Location();public: __property void set_Location(String*);
[JScript]
public function get Location() : String;public function set Location(String);

プロパティ値

バインディングが定義されている場所。既定値は、属性が適用される XML Web サービスの URL です。

使用例

[Visual Basic, C#] https://www.contoso.com/MyBinding 名前空間のメンバであり、 https://www.contoso.com/MyService.asmx?wsdl で定義されている、 RemoteBinding という名前のバインディングを指定する例を次に示します。

 
' Binding is defined on a remote server, but this XML Web service implements at
' least one operation in that binding.
<WebServiceBinding(Name := "RemoteBinding", _
    Namespace := "https://www.contoso.com/MyBinding", _
    Location := "https://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


[C#] 
// Binding is defined on a remote server, but this XML Web service 
// implements at least one operation in that binding.
[ WebServiceBinding(Name="RemoteBinding",
    Namespace="https://www.contoso.com/MyBinding",
    Location="https://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";
    }
}

[C++, JScript] C++ および JScript のサンプルはありません。Visual Basic および C# のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ, .NET Compact Framework - Windows CE .NET

参照

WebServiceBindingAttribute クラス | WebServiceBindingAttribute メンバ | System.Web.Services 名前空間 | SoapDocumentMethodAttribute