SoapRpcMethodAttribute.Binding プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > SoapRpcMethodAttribute.Binding プロパティの意味・解説 

SoapRpcMethodAttribute.Binding プロパティ

XML Web サービス メソッド実装している操作バインディング取得または設定します

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

解説解説

バインディングは、Web サービス記述言語 (WSDL: Web Services Description Language) によって定義されており、具体的な操作セット定義している点でインターフェイス似てます。ASP.NET では、各 XML Web サービス メソッド1 つバインディング内の 1 つ操作です。XML Web サービス メソッドは、XML Web サービス既定バインディングメンバ、または XML Web サービス適用される WebServiceBindingAttribute 内で指定されバインディングメンバなりますXML Web サービスは、複数WebServiceBindingAttribute 属性適用されている場合には、複数バインディング実装できます

WebServiceBindingAttribute 属性XML Web サービス適用すると、SoapDocumentMethodAttribute または SoapRpcMethodAttribute を個別XML Web サービス メソッド適用し特定の XML Web サービス メソッドによって実装されるバインディング操作指定できますSoapDocumentMethodAttribute または SoapRpcMethodAttributeBinding プロパティ設定してXML Web サービス メソッド操作実装する対象となるバインディング指定しますXML Web サービス メソッド適用できるのは、1 つSoapDocumentMethodAttribute または SoapRpcMethodAttribute だけです。したがってXML Web サービス メソッド実装できるのは、1 つバインディングに対して 1 つ操作だけです。

使用例使用例

XML Web サービス内に複数バインディング実装する方法次のコード例示します

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

 ' Three bindings are defined
   < 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  

      < SoapRpcMethod(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

          < SoapRpcMethodAttribute(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
    
          < SoapRpcMethodAttribute(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 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  {

      [ SoapRpcMethod(Binding="LocalBinding")]
      [ WebMethod ]
      public string LocalBindingMethod() {
               return "Member of binding defined in
 this XML Web service and member of the default
 namespace";
      }
      [ SoapRpcMethodAttribute(Binding="LocalBindingNonDefaultNamespace")]
 
      [ WebMethod ]
      public string LocalBindingNonDefaultNamespaceMethod()
 {
              return "Member of binding defined in
 this XML Web service, but a part of a different namespace";
      }

     [ SoapRpcMethodAttribute(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";
      }
 
 }   
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
SoapRpcMethodAttribute クラス
SoapRpcMethodAttribute メンバ
System.Web.Services.Protocols 名前空間
WebServiceBindingAttribute クラス



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

辞書ショートカット

すべての辞書の索引

SoapRpcMethodAttribute.Binding プロパティのお隣キーワード
検索ランキング

   

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



SoapRpcMethodAttribute.Binding プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS