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

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > SoapDocumentMethodAttribute クラスの意味・解説 

SoapDocumentMethodAttribute クラス

SoapDocumentMethodAttributeメソッド適用することにより、そのメソッドとの間で送受信される SOAP メッセージDocument 書式適用することを指定できます

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

<AttributeUsageAttribute(AttributeTargets.Method)> _
Public NotInheritable Class
 SoapDocumentMethodAttribute
    Inherits Attribute
Dim instance As SoapDocumentMethodAttribute
[AttributeUsageAttribute(AttributeTargets.Method)] 
public sealed class SoapDocumentMethodAttribute
 : Attribute
[AttributeUsageAttribute(AttributeTargets::Method)] 
public ref class SoapDocumentMethodAttribute
 sealed : public Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Method) */ 
public final class SoapDocumentMethodAttribute
 extends Attribute
AttributeUsageAttribute(AttributeTargets.Method) 
public final class SoapDocumentMethodAttribute
 extends Attribute
解説解説
使用例使用例

GetUserName XML Web サービス メソッドに対してメッセージ スタイルDocument設定するコード例次に示しますまた、SOAP 要求SOAP 応答Body 要素関連付けられている XML 要素として、それぞれ GetUserNameRequestGetUserNameResponse設定されています。

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

Public Class MyUser
    Inherits WebService    
    
    <SoapDocumentMethod(Action := "http://www.contoso.com/Sample",
 _
    RequestNamespace := "http://www.contoso.com/Request",
 _
    RequestElementName := "GetUserNameRequest", _
    ResponseNamespace := "http://www.contoso.com/Response",
 _
    ResponseElementName := "GetUserNameResponse"),
 _
    WebMethod(Description := "Obtains the User Name")>
 _
    Public Function GetUserName() As
 UserName
        
        Dim temp As String
        Dim pos As Integer
        Dim NewUser As New
 UserName()
        
        ' Get the full user name, including the domain name if applicable.
        temp = User.Identity.Name
        
        ' Deterime whether the user is part of a Domain by searching
 for a backslash.
        pos = temp.IndexOf("\")
        
        ' Parse the domain name out of the string, if one exists.
        If pos <= 0 Then
            NewUser.Name = User.Identity.Name
        Else
            NewUser.Name = temp.Remove(0, pos + 1)
            NewUser.Domain = temp.Remove(pos, temp.Length - pos)
        End If
        Return NewUser
    End Function
End Class 

Public Class UserName
    
    Public Name As String
    Public Domain As String
End Class

<%@ WebService Language="C#" class="MyUser"
 %>
 using System;
 using System.Web.Services;
 using System.Web.Services.Protocols;
 
 public class MyUser : WebService {
 
       [ SoapDocumentMethod(Action="http://www.contoso.com/Sample",
 
           RequestNamespace="http://www.contoso.com/Request"
,
           RequestElementName="GetUserNameRequest",
           ResponseNamespace="http://www.contoso.com/Response"
,
           ResponseElementName="GetUserNameResponse")]
      [ WebMethod(Description="Obtains the User Name") ]
      public UserName GetUserName() {
           string temp;
           int pos;
           UserName NewUser = new UserName();
           
           // Get the full user name, including the domain name if applicable.
           temp = User.Identity.Name;
 
           // Deterime whether the user is part of a domain by searching
 for a backslash.
           pos = temp.IndexOf("\\");
           
           // Parse the domain name out of the string, if one exists.
           if (pos <= 0)
                 NewUser.Name = User.Identity.Name;
           else {
               NewUser.Name = temp.Remove(0,pos+1);
                 NewUser.Domain = temp.Remove(pos,temp.Length-pos);
           } 
       return NewUser;
      }
 
 }   
 
 public class UserName {
 
     public string Name;
     public string Domain;
 }

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


このページでは「.NET Framework クラス ライブラリ リファレンス」からSoapDocumentMethodAttribute クラスを検索した結果を表示しています。
Weblioに収録されているすべての辞書からSoapDocumentMethodAttribute クラスを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からSoapDocumentMethodAttribute クラス を検索

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

辞書ショートカット

すべての辞書の索引

「SoapDocumentMethodAttribute クラス」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS