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

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > 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



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

辞書ショートカット

すべての辞書の索引

「WebServiceBindingAttribute クラス」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS