WebServiceBindingAttributeとは? わかりやすく解説

WebServiceBindingAttribute クラス

1 つ以上の XML Web サービス メソッドを定義するバインディングを宣言します。このクラスは継承できません。

名前空間: System.Web.Services
アセンブリ: System.Web.Services (system.web.services.dll 内)
構文構文

<AttributeUsageAttribute(AttributeTargets.Class Or AttributeTargets.Interface,
 AllowMultiple:=True)> _
Public NotInheritable Class
 WebServiceBindingAttribute
    Inherits Attribute
Dim instance As WebServiceBindingAttribute
[AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Interface, AllowMultiple=true)]
 
public sealed class WebServiceBindingAttribute
 : Attribute
[AttributeUsageAttribute(AttributeTargets::Class|AttributeTargets::Interface, AllowMultiple=true)]
 
public ref class WebServiceBindingAttribute
 sealed : public Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Interface,
 AllowMultiple=true) */ 
public final class WebServiceBindingAttribute
 extends Attribute
AttributeUsageAttribute(AttributeTargets.Class|AttributeTargets.Interface, AllowMultiple=true)
 
public final class WebServiceBindingAttribute
 extends Attribute
解説解説
使用例使用例

4 つのバインディングで操作を実装する XML Web サービスを次に示します。特に、XML Web サービスは、3 つの WebServiceBindingAttribute 属性を XML Web サービスに適用して、操作を実装する対象となる 3 つのバインディングを宣言します。

XML Web サービス メソッドが操作を実装する対象であるバインディングを指定するために、DefaultBindingMethod を除く各 XML Web サービス メソッドに SoapDocumentMethodAttribute が適用されます。DefaultBindingMethod のバインディングを指定しないことによって、XML Web サービスの既定のバインディングに操作を実装しています。

<%@ WebService Language="VB" class="BindingSample"
 %>
Imports System
Imports System.Web.Services
Imports System.Web.Services.Protocols

' Binding is defined in this XML Web service and uses the default namespace.
' Binding is defined in this XML Web service, but it is not a part of
 the default
' namespace.
' Binding is defined on a remote server, but this XML Web service implements
 at
' least one operation in that binding.
<WebServiceBinding(Name := "LocalBinding"), _ 
 WebServiceBinding(Name := "LocalBindingNonDefaultNamespace",
 _ 
                   Namespace := "http://www.contoso.com/MyBinding"),
 _     
 WebServiceBinding(Name := "RemoteBinding", _ 
                   Namespace := "http://www.contoso.com/MyBinding",
 _
                   Location := "http://www.contoso.com/MySevice.asmx?wsdl")>
 _
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
    
    <SoapDocumentMethod(Binding := "LocalBindingNonDefaultNamespace"),
 WebMethod()> _
    Public Function LocalBindingNonDefaultNamespaceMethod()
 As String
    
        Return "Member o1f binding defined
 in this XML Web service, but a part of a different namespace"
    End Function    
    
    <SoapDocumentMethod(Binding := "RemoteBinding"),
 WebMethod()> _
    Public Function RemoteBindingMethod() As
 String
    
        Return "Member of a binding defined
 on another server"
    End Function    
    
    <WebMethod()> _
    Public Function DefaultBindingMethod()
 As String
    
        Return "Member of the default binding"
    End Function
End Class

<%@ 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")]

 // Binding is defined in this XML Web service, but it is not a part
 of the default namespace.
 [ WebServiceBinding(Name="LocalBindingNonDefaultNamespace", 
             Namespace="http://www.contoso.com/MyBinding"
 )]

 // 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/MySevice.asmx?wsdl")]
 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";
      }
      [ SoapDocumentMethod(Binding="LocalBindingNonDefaultNamespace")]
 
      [ WebMethod() ]
      public string LocalBindingNonDefaultNamespaceMethod()
 {
              return "Member of binding defined in
 this XML Web service, but a part of a different namespace";
      }

     [ SoapDocumentMethod(Binding="RemoteBinding")] 
     [ WebMethod() ]
      public string RemoteBindingMethod() {
              return "Member of a binding defined on another
 server";
      }

      [ WebMethod() ]
      public string DefaultBindingMethod()
 {
              return "Member of the default
 binding";
      }
 
 }

継承階層継承階層
System.Object
   System.Attribute
    System.Web.Services.WebServiceBindingAttribute
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WebServiceBindingAttribute メンバ
System.Web.Services 名前空間
SoapDocumentMethodAttribute
SoapRpcMethodAttribute

WebServiceBindingAttribute コンストラクタ ()

WebServiceBindingAttribute クラスの新しいインスタンスを初期化します。

名前空間: System.Web.Services
アセンブリ: System.Web.Services (system.web.services.dll 内)
構文構文

Dim instance As New WebServiceBindingAttribute
public WebServiceBindingAttribute ()
public:
WebServiceBindingAttribute ()
public WebServiceBindingAttribute ()
public function WebServiceBindingAttribute
 ()
使用例使用例
' 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

// 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";
    }
}

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WebServiceBindingAttribute クラス
WebServiceBindingAttribute メンバ
System.Web.Services 名前空間

WebServiceBindingAttribute コンストラクタ (String)

XML Web サービス メソッドが実装しているバインディングの名前を設定する WebServiceBindingAttribute クラスの新しいインスタンスを初期化します。

名前空間: System.Web.Services
アセンブリ: System.Web.Services (system.web.services.dll 内)
構文構文

Dim name As String

Dim instance As New WebServiceBindingAttribute(name)
public WebServiceBindingAttribute (
    string name
)
public:
WebServiceBindingAttribute (
    String^ name
)
public WebServiceBindingAttribute (
    String name
)
public function WebServiceBindingAttribute
 (
    name : String
)

パラメータ

name

XML Web サービス メソッドが操作を実装する対象となるバインディングの名前。Name プロパティを設定します。

解説解説
使用例使用例

BindingSample XML Web サービスで定義されている LocalBinding という名前のバインディングを指定する例を次に示します。

' 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
   
// 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";
      }

 }
   
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WebServiceBindingAttribute クラス
WebServiceBindingAttribute メンバ
System.Web.Services 名前空間
Name
SoapDocumentMethodAttribute
SoapRpcMethodAttribute

WebServiceBindingAttribute コンストラクタ (String, String)

WebServiceBindingAttribute クラスの新しいインスタンスを初期化します。

名前空間: System.Web.Services
アセンブリ: System.Web.Services (system.web.services.dll 内)
構文構文

Dim name As String
Dim ns As String

Dim instance As New WebServiceBindingAttribute(name,
 ns)
public WebServiceBindingAttribute (
    string name,
    string ns
)
public:
WebServiceBindingAttribute (
    String^ name, 
    String^ ns
)
public WebServiceBindingAttribute (
    String name, 
    String ns
)
public function WebServiceBindingAttribute
 (
    name : String, 
    ns : String
)

パラメータ

name

XML Web サービス メソッドが操作を実装する対象となるバインディングの名前。Name プロパティを設定します。

ns

バインディングに関連付けられた名前空間。Namespace プロパティを設定します。

解説解説
使用例使用例

http://www.contoso.com/MyBinding 名前空間のメンバであり、BindingSample XML Web サービスで定義されている、LocalBindingNonDefaultNamespace という名前のバインディングを指定する例を次に示します。

' Binding is defined in this XML Web service, but it is not a part of
 the default namespace.
<WebServiceBinding(Name := "LocalBindingNonDefaultNamespace",
 _
    Namespace := "http://www.contoso.com/MyBinding")>
 _
Public Class BindingSample   
    
    <SoapDocumentMethod(Binding := "LocalBindingNonDefaultNamespace"),
 _
        WebMethod()> _
    Public Function LocalBindingNonDefaultNamespaceMethod()
 As String
        
        Return "Member of binding defined in
 this XML Web service, but a part " & _
               "of a different namespace"
    End Function
End Class
 
// Binding is defined in this XML Web service, but it is not a part
 of the default namespace.
 [ WebServiceBinding(Name="LocalBindingNonDefaultNamespace",
 Namespace="http://www.contoso.com/MyBinding")]
 public class BindingSample  {

      [ SoapDocumentMethod(Binding="LocalBindingNonDefaultNamespace")]
 
      [ WebMethod() ]
      public string LocalBindingNonDefaultNamespaceMethod()
 {
              return "Member of binding defined in
 this XML Web service, but a part of a different namespace";
      }
 }
 
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WebServiceBindingAttribute クラス
WebServiceBindingAttribute メンバ
System.Web.Services 名前空間
Name
Namespace
SoapDocumentMethodAttribute
SoapRpcMethodAttribute

WebServiceBindingAttribute コンストラクタ (String, String, String)

WebServiceBindingAttribute クラスの新しいインスタンスを初期化します。

名前空間: System.Web.Services
アセンブリ: System.Web.Services (system.web.services.dll 内)
構文構文

解説解説
使用例使用例

http://www.contoso.com/MyBinding 名前空間のメンバであり、http://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 := "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
 
// 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";
      }
 }
 
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WebServiceBindingAttribute クラス
WebServiceBindingAttribute メンバ
System.Web.Services 名前空間
Location
Name
Namespace
SoapDocumentMethodAttribute
SoapRpcMethodAttribute

WebServiceBindingAttribute コンストラクタ

WebServiceBindingAttribute クラスの新しいインスタンスを初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
WebServiceBindingAttribute () WebServiceBindingAttribute クラスの新しいインスタンスを初期化します。

.NET Compact Framework によってサポートされています。

WebServiceBindingAttribute (String) XML Web サービス メソッドが実装しているバインディングの名前を設定する WebServiceBindingAttribute クラスの新しいインスタンスを初期化します。

.NET Compact Framework によってサポートされています。

WebServiceBindingAttribute (String, String) WebServiceBindingAttribute クラスの新しいインスタンスを初期化します。

.NET Compact Framework によってサポートされています。

WebServiceBindingAttribute (String, String, String) WebServiceBindingAttribute クラスの新しいインスタンスを初期化します。

.NET Compact Framework によってサポートされています。

参照参照

関連項目

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

WebServiceBindingAttribute プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ ConformsTo バインディングが準拠していることを示す Web Services Interoperability (WSI) 仕様を取得または設定します。
パブリック プロパティ EmitConformanceClaims バインディングが準拠の表示を出力するかどうかを示す値を取得または設定します。
パブリック プロパティ .NET Compact Framework によるサポート .NET Compact Framework によるサポート .NET Compact Framework によるサポート TypeId  派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。 ( Attribute から継承されます。)
参照参照

関連項目

WebServiceBindingAttribute クラス
System.Web.Services 名前空間
SoapDocumentMethodAttribute
SoapRpcMethodAttribute

WebServiceBindingAttribute メソッド


パブリック メソッドパブリック メソッド

( プロテクト メソッド も参照)
  名前 説明
パブリック メソッド Equals  オーバーロードされます。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttribute  オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用された指定した型のカスタム属性を取得します。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されたカスタム属性の配列を取得します。 ( Attribute から継承されます。)
パブリック メソッド GetHashCode  このインスタンスのハッシュ コードを返します。 ( Attribute から継承されます。)
パブリック メソッド GetType  現在のインスタンスの Type を取得します。 ( Object から継承されます。)
パブリック メソッド IsDefaultAttribute  派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラスの既定値かどうかを示します。 ( Attribute から継承されます。)
パブリック メソッド IsDefined  オーバーロードされます。 指定した型のカスタム属性が、アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されているかどうかを判断します。 ( Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 ( Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String を返します。 ( Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

WebServiceBindingAttribute クラス
System.Web.Services 名前空間
SoapDocumentMethodAttribute
SoapRpcMethodAttribute

WebServiceBindingAttribute メンバ

1 つ以上の XML Web サービス メソッドを定義するバインディングを宣言します。このクラスは継承できません。

WebServiceBindingAttribute データ型で公開されるメンバを以下の表に示します。


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド WebServiceBindingAttribute オーバーロードされます。 WebServiceBindingAttribute クラスの新しいインスタンスを初期化します。
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ ConformsTo バインディングが準拠していることを示す Web Services Interoperability (WSI) 仕様を取得または設定します。
パブリック プロパティ EmitConformanceClaims バインディングが準拠の表示を出力するかどうかを示す値を取得または設定します。
パブリック プロパティ .NET Compact Framework によるサポート .NET Compact Framework によるサポート .NET Compact Framework によるサポート TypeId  派生クラスに実装されている場合は、この Attribute の一意の識別子を取得します。(Attribute から継承されます。)
パブリック メソッドパブリック メソッド
( プロテクト メソッド も参照)
  名前 説明
パブリック メソッド Equals  オーバーロードされます。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttribute  オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用された指定した型のカスタム属性を取得します。 (Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされます。 アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されたカスタム属性の配列を取得します。 (Attribute から継承されます。)
パブリック メソッド GetHashCode  このインスタンスのハッシュ コードを返します。 (Attribute から継承されます。)
パブリック メソッド GetType  現在のインスタンスの Type を取得します。 (Object から継承されます。)
パブリック メソッド IsDefaultAttribute  派生クラス内でオーバーライドされたときに、このインスタンスの値が派生クラスの既定値かどうかを示します。 (Attribute から継承されます。)
パブリック メソッド IsDefined  オーバーロードされます。 指定した型のカスタム属性が、アセンブリ、モジュール、型のメンバ、またはメソッド パラメータに適用されているかどうかを判断します。 (Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。 (Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String を返します。 (Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

WebServiceBindingAttribute クラス
System.Web.Services 名前空間
SoapDocumentMethodAttribute
SoapRpcMethodAttribute



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「WebServiceBindingAttribute」の関連用語

WebServiceBindingAttributeのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



WebServiceBindingAttributeのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS