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



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「WebServiceBindingAttribute」の関連用語

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

   

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



WebServiceBindingAttributeのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS