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

XmlFormatExtensionAttribute クラス

サービス記述形式拡張機能1 つ上の拡張ポイント実行することを指定します。このクラス継承できません。

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

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

サービス記述形式拡張機能は、ASP.NET使用して作成した XML Web サービスに関するサービス説明生成する方法について、機能拡張します。具体的には、サービス記述形式拡張機能によって、サービス説明XML 要素追加されます。SOAP 拡張機能に関する情報サービス説明含まれないため、SOAP 拡張機能XML Web サービスクライアント側サーバー側の両方実行できるように構築する場合には、この機能役に立ちますSOAP 拡張機能に関する情報サービス説明追加すると、クライアント特定の SOAP 拡張機能実行する必要がある解釈しますクライアントサーバー両方実行する必要のある SOAP 拡張機能の例には、暗号化 SOAP 拡張機能あります暗号化 SOAP 拡張機能サーバーでだけ実行されていて、戻り値暗号化してからクライアント返信する場合クライアントでも同じ SOAP 拡張機能実行して SOAP メッセージ復号化する必要がありますそれ以外場合クライアント戻り値を処理できません。

次の手順実行してサービス記述形式拡張機能作成します

  1. ServiceDescriptionFormatExtension から派生するクラス構築します

  2. XmlFormatExtensionAttributeクラス適用しサービス記述形式拡張機能実行される拡張ポイント指定します

  3. XmlFormatExtensionPointAttribute をクラス適用しクラス内のメンバ新し拡張ポイントとして機能することをオプション指定します

  4. オプションで、XmlFormatExtensionPrefixAttribute をクラス適用しサービス記述形式拡張機能によって生成されXML 要素XML 名前空間プリフィックス関連付けるように指定します

  5. 構成ファイルserviceDescriptionFormatExtensionTypes セクション実行するサービス記述形式拡張機能設定します

使用例使用例
Imports System
Imports System.Security.Permissions
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.IO
Imports System.Text
Imports System.Web.Services.Configuration
Imports System.Web.Services.Description
Imports System.Xml.Serialization
Imports System.CodeDom

' The YMLAttribute allows a developer to specify that the YML SOAP
' extension run on a per-method basis.  The disabled property
' turns reversing the XML on and off. 

<AttributeUsage(AttributeTargets.Method, AllowMultiple:=False)> _
Public Class YMLAttribute
    Inherits SoapExtensionAttribute
    Dim _priority As Integer
 = 0
    Dim _disabled As Boolean
 = False

    Public Sub New()
        Me.New(False)
    End Sub

    Public Sub New(ByVal
 Disabled As Boolean)
        _disabled = Disabled
    End Sub

    Public Overrides ReadOnly
 Property ExtensionType() As Type
        Get
            Return GetType(YMLExtension)
        End Get
    End Property

    Public Overrides Property
 Priority() As Integer
        Get
            Return _priority
        End Get
        Set(ByVal Value As
 Integer)
            _priority = Value
        End Set
    End Property

    Public Property Disabled() As
 Boolean
        Get
            Return _disabled
        End Get
        Set(ByVal Value As
 Boolean)
            _disabled = Value
        End Set
    End Property
End Class

Public Class YMLExtension
    Inherits SoapExtension
    Dim _disabled As Boolean
 = False
    Dim oldStream As Stream
    Dim newStream As Stream

    Public Overloads Overrides
 Function GetInitializer( _
        ByVal methodInfo As LogicalMethodInfo,
 _
        ByVal attribute As SoapExtensionAttribute)
 As Object

        Dim attr As YMLAttribute = attribute
        If (Not attr Is
 Nothing) Then
            Return attr.Disabled
        End If
        Return False
    End Function

    Public Overloads Overrides
 Function GetInitializer( _
        ByVal WebServiceType As Type) As
 Object
        Return False
    End Function

    Public Overrides Sub
 Initialize(ByVal initializer As Object)
        If (TypeOf initializer Is
 Boolean) Then
            _disabled = CBool(initializer)
        End If
    End Sub

    Public Overrides Function
 ChainStream(ByVal streamref As Stream) As
 Stream
        If (_disabled) Then
            Return CType(Me, SoapExtension).ChainStream(streamref)
        End If
        oldStream = streamref
        newStream = New MemoryStream()
        Return newStream
    End Function

    Public Overrides Sub
 ProcessMessage(ByVal message As SoapMessage)
        If (_disabled) Then Return
        Select Case (message.Stage)
            Case SoapMessageStage.BeforeSerialize
                Encode(message)
            Case SoapMessageStage.AfterSerialize
                newStream.Position = 0
                Reverse(newStream, oldStream)
            Case SoapMessageStage.BeforeDeserialize
                Decode(message)
            Case SoapMessageStage.AfterDeserialize
        End Select
    End Sub

    Sub Encode(ByRef message As
 SoapMessage)
        message.ContentType = "text/yml"
    End Sub

    Sub Decode(ByVal message As
 SoapMessage)
        If (message.ContentType <> "text/yml")
 Then
            Throw New Exception("invalid
 content type:" & message.ContentType)
        End If
        Reverse(oldStream, newStream)
        newStream.Position = 0
        message.ContentType = "text/xml"
    End Sub

    Sub Reverse(ByVal source As
 Stream, ByVal dest As Stream)
        Dim reader As TextReader = New
 StreamReader(source)
        Dim writer As TextWriter = New
 StreamWriter(dest)
        Dim line As String
        line = reader.ReadLine()
        While (Not line Is
 Nothing)
            writer.WriteLine(StrReverse(line))
            line = reader.ReadLine()
        End While
        writer.Flush()
    End Sub
End Class


' The YMLReflector class is part of the YML SDFE, as it is
' called during the service description generation process.
<PermissionSet(SecurityAction.Demand, Name:="FullTrust")>
 _
Public Class YMLReflector
    Inherits SoapExtensionReflector
    Public Overrides Sub
 ReflectMethod()
        Dim reflector As ProtocolReflector
 = ReflectionContext
        Dim attr As YMLAttribute = _
            reflector.Method.GetCustomAttribute(GetType(YMLAttribute))
        ' If the YMLAttribute has been applied to this XML Web service
 
        ' method, add the XML defined in the YMLOperationBinding class.
        If (Not attr Is
 Nothing) Then
            Dim yml As YMLOperationBinding
 = New YMLOperationBinding()
            yml.Reverse = Not attr.Disabled
            reflector.OperationBinding.Extensions.Add(yml)
        End If
    End Sub
End Class

' The YMLImporter class is part of the YML SDFE, as it is called when
 a
' proxy class is generated for each XML Web service method the proxy
 class
' communicates with. The class checks whether the service description
' contains the XML that this SDFE adds to a service description. If
 it 
' exists, then the YMLExtension is applied to the method in the proxy
 class.
<PermissionSet(SecurityAction.Demand, Name:="FullTrust")>
 _
Public Class YMLImporter
    Inherits SoapExtensionImporter
    Public Overrides Sub
 ImportMethod( _
        ByVal metadata As CodeAttributeDeclarationCollection)
        Dim importer As SoapProtocolImporter
 = ImportContext
        ' Check whether the XML specified in the YMLOperationBinding
 is 
        ' in the service description.
        Dim yml As YMLOperationBinding = _
            importer.OperationBinding.Extensions.Find( _
            GetType(YMLOperationBinding))
        If (Not yml Is Nothing)
 Then
            ' Only apply the YMLAttribute to the method when the XML
 
            ' should be reversed.
            If (yml.Reverse) Then
                Dim attr As CodeAttributeDeclaration
 = _
                    New CodeAttributeDeclaration(GetType(YMLAttribute).FullName)
                attr.Arguments.Add( _
                    New CodeAttributeArgument(New
 CodePrimitiveExpression(True)))
                metadata.Add(attr)
            End If
        End If
    End Sub
End Class

' The YMLOperationBinding class is part of the YML SDFE, as it is the
' class that is serialized into XML and is placed in the service
' description.
<XmlFormatExtension("action", YMLOperationBinding.YMLNamespace,
 _
    GetType(OperationBinding)), _
    XmlFormatExtensionPrefix("yml", YMLOperationBinding.YMLNamespace)>
 _
Public Class YMLOperationBinding
    Inherits ServiceDescriptionFormatExtension
    Private _reverse As Boolean
    Public Const YMLNamespace As
 String = "http://www.contoso.com/yml"

    <XmlElement("Reverse")> _
    Public Property Reverse() As
 Boolean
        Get
            Return _reverse
        End Get
        Set(ByVal Value As
 Boolean)
            _reverse = Value
        End Set
    End Property

End Class
using System;
using System.Security.Permissions;
using System.CodeDom;
using System.IO;
using System.Text;
using System.Web.Services.Configuration;
using System.Web.Services.Description;
using System.Web.Services.Protocols;
using System.Xml.Serialization;


// The YMLAttribute allows a developer to specify that the YML SOAP
// extension run on a per-method basis.  The Disabled property
// turns reversing the XML on and off. 

[AttributeUsage(AttributeTargets.Method, AllowMultiple=false)]
public class YMLAttribute : SoapExtensionAttribute
 {
    int priority = 0;
    bool disabled = false;
    
    public YMLAttribute() : this(false)
 {}
    public YMLAttribute(bool disabled) 
    {
        this.disabled = disabled;
    }
    
    public override Type ExtensionType 
    {
        get { return typeof(YMLExtension);
 }
    }
    public override int Priority 
    {
        get { return priority; }
        set { priority = value; }
    }

    public bool Disabled 
    { 
        get { return disabled; }
        set { disabled = value; }
    }
}

public class YMLExtension : SoapExtension {
    bool disabled = false;
    Stream oldStream;
    Stream newStream;

    public override object GetInitializer(LogicalMethodInfo methodInfo,
 
        SoapExtensionAttribute attribute) 
    {
        YMLAttribute attr = attribute as YMLAttribute;
        if (attr != null) return
 attr.Disabled;
        return false;
    }

    public override object GetInitializer(Type serviceType) 
    {
        return false;
    }

    public override void Initialize(object
 initializer) 
    {
        if (initializer is Boolean) disabled = (bool)initializer;
    }

    public override Stream ChainStream(Stream stream) 
    {
        if (disabled) return base.ChainStream(stream);
        oldStream = stream;
        newStream = new MemoryStream();
        return newStream;
    }

    public override void ProcessMessage(SoapMessage
 message) 
    {
        if (disabled) return;
        switch (message.Stage) 
        {
        case SoapMessageStage.BeforeSerialize:
            Encode(message);
            break;
        case SoapMessageStage.AfterSerialize:
            newStream.Position = 0;
            Reverse(newStream, oldStream);
            break;
        case SoapMessageStage.BeforeDeserialize:
            Decode(message);
            break;
        case SoapMessageStage.AfterDeserialize:
            break;
        }
    }        

    void Encode(SoapMessage message) 
    {
        message.ContentType = "text/yml";
    }

    void Decode(SoapMessage message) 
    {
        if (message.ContentType != "text/yml") 
            throw new Exception(
                "invalid content type:" + message.ContentType);
        Reverse(oldStream, newStream);
        newStream.Position = 0;
        message.ContentType = "text/xml";
    }

    void Reverse(Stream from, Stream to) 
    {
        TextReader reader = new StreamReader(from);
        TextWriter writer = new StreamWriter(to);
        string line;
        while ((line = reader.ReadLine()) != null)
 
        {
            StringBuilder builder = new StringBuilder();
            for (int i = line.Length - 1; i
 >= 0; i--) 
            {
                builder.Append(line[i]);
            }
            writer.WriteLine(builder.ToString());
        }
        writer.Flush();
    }
}
// The YMLReflector class is part of the YML SDFE, as it is
// called during the service description generation process.
[PermissionSet(SecurityAction.Demand, Name="FullTrust")]
public class YMLReflector : SoapExtensionReflector
 
{
    public override void ReflectMethod() 
    {
        ProtocolReflector reflector = ReflectionContext;
        YMLAttribute attr = 
            (YMLAttribute)reflector.Method.GetCustomAttribute(
            typeof(YMLAttribute));
        // If the YMLAttribute has been applied to this XML Web service
 
        // method, add the XML defined in the YMLOperationBinding class.
        if (attr != null) 
        {
            YMLOperationBinding yml = new YMLOperationBinding();
            yml.Reverse = !(attr.Disabled);
            reflector.OperationBinding.Extensions.Add(yml);
        }
    }
}



// The YMLImporter class is part of the YML SDFE, as it is called when
 a
// proxy class is generated for each XML Web service method the proxy
 class
// communicates with. The class checks whether the service description
// contains the XML that this SDFE adds to a service description. If
 it 
// exists, then the YMLExtension is applied to the method in the proxy
 class.
[PermissionSet(SecurityAction.Demand, Name="FullTrust")]
public class YMLImporter : SoapExtensionImporter
 
{
    public override void ImportMethod(
        CodeAttributeDeclarationCollection metadata) 
    {
        SoapProtocolImporter importer = ImportContext;
        // Check whether the XML specified in the YMLOperationBinding
 
        // is in the service description.
        YMLOperationBinding yml = 
           (YMLOperationBinding)importer.OperationBinding.Extensions.Find(
           typeof(YMLOperationBinding));
        if (yml != null)
        {
            // Only apply the YMLAttribute to the method when the XML
 should
            // be reversed.
            if (yml.Reverse)
            {
                CodeAttributeDeclaration attr = 
                    new CodeAttributeDeclaration(typeof(YMLAttribute).FullName);
                attr.Arguments.Add(
                    new CodeAttributeArgument(new
 CodePrimitiveExpression(true)));
                metadata.Add(attr);
            }
        }
    }
}

// The YMLOperationBinding class is part of the YML SDFE, as it is the
// class that is serialized into XML and is placed in the service
// description.
[XmlFormatExtension("action", YMLOperationBinding.YMLNamespace, 
    typeof(OperationBinding))]
[XmlFormatExtensionPrefix("yml", YMLOperationBinding.YMLNamespace)]
public class YMLOperationBinding : ServiceDescriptionFormatExtension
 
{
    private Boolean reverse;

    public const string
 YMLNamespace = "http://www.contoso.com/yml";

    [XmlElement("Reverse")]
    public Boolean Reverse 
    {
        get { return reverse; }
        set { reverse = value; }
    }
}
import System.*;
import System.CodeDom.*;
import System.IO.*;
import System.Text.*;
import System.Web.Services.Configuration.*;
import System.Web.Services.Description.*;
import System.Web.Services.Protocols.*;
import System.Xml.Serialization.*;

// The YMLAttribute allows a developer to specify that the YML SOAP
// extension run on a per-method basis.  The Disabled property
// turns reversing the XML on and off. 
/** @attribute AttributeUsage(AttributeTargets.Method, AllowMultiple = false)
 */
public class YMLAttribute extends SoapExtensionAttribute
{
    private int priority = 0;
    private boolean disabled = false;

    public YMLAttribute()
    {
      this(false);
    } //YMLAttribute

    public YMLAttribute(boolean disabled)
    {
        this.disabled = disabled;
    } //YMLAttribute

    /** @property 
     */
    public Type get_ExtensionType()
    {
        return YMLExtension.class.ToType();
    } //get_ExtensionType

    /** @property 
     */
    public int get_Priority()
    {
        return priority;
    } //get_Priority

    /** @property 
     */
    public void set_Priority(int
 value)
    {
        priority = value;
    } //set_Priority

    /** @property 
     */
    public boolean get_Disabled()
    {
        return disabled;
    } //get_Disabled

    /** @property 
     */
    public void set_Disabled(boolean value)
    {
        disabled = value;
    } //set_Disabled
} //YMLAttribute

public class YMLExtension extends SoapExtension
{
    private boolean disabled = false;
    private Stream oldStream;
    private Stream newStream;

    public Object GetInitializer(LogicalMethodInfo methodInfo,
 
        SoapExtensionAttribute attribute)
    {
        YMLAttribute attr =(YMLAttribute)attribute;
        if (attr != null) {
            return (System.Boolean)attr.get_Disabled();
        }
        return (System.Boolean)false;
    } //GetInitializer

    public Object GetInitializer(Type serviceType)
    {
        return (System.Boolean)false;
    } //GetInitializer

    public void Initialize(Object initializer)
    {
        if (initializer instanceof Boolean) {
            disabled = System.Convert.ToBoolean(initializer);
        }
    } //Initialize

    public Stream ChainStream(Stream stream)
    {
        if (disabled) {
            return super.ChainStream(stream);
        }
        oldStream = stream;
        newStream = new MemoryStream();
        return newStream;
    } //ChainStream

    public void ProcessMessage(SoapMessage
 message) throws Exception
    {
        if (disabled) {
            return;
        }
        switch (message.get_Stage()) {
            case SoapMessageStage.BeforeSerialize:
                Encode(message);
                break;

            case SoapMessageStage.AfterSerialize:
                newStream.set_Position(0);
                Reverse(newStream, oldStream);
                break;

            case SoapMessageStage.BeforeDeserialize:
                Decode(message);
                break;

            case SoapMessageStage.AfterDeserialize:
                break;
        }
    } //ProcessMessage

    void Encode(SoapMessage message)
    {
        message.set_ContentType("text/yml");
    } //Encode

    void Decode(SoapMessage message) throws Exception
    {
        if (!(message.get_ContentType()).Equals("text/yml"))
 {
            throw new Exception("invalid content type:"
 
                + message.get_ContentType());
        }
        Reverse(oldStream, newStream);
        newStream.set_Position(0);
        message.set_ContentType("text/xml");
    } //Decode

    void Reverse(Stream from, Stream to)
    {
        TextReader reader = new StreamReader(from);
        TextWriter writer = new StreamWriter(to);
        String line;
        while ((line = reader.ReadLine()) != null)
 {
            StringBuilder builder = new StringBuilder();
            for (int i = line.get_Length()
 - 1; i >= 0; i--) {
                builder.Append(line.GetEnumerator().get_Current());
            }
            writer.WriteLine(builder.ToString());
        }
        writer.Flush();
    } //Reverse
} //YMLExtension

// The YMLReflector class is part of the YML SDFE, as it is
// called during the service description generation process.
/** @attribute System.Security.Permissions.PermissionSet(System.Security.
    Permissions.SecurityAction.Demand, Name = "FullTrust")
 */
public class YMLReflector extends SoapExtensionReflector
{
    public void ReflectMethod()
    {
        ProtocolReflector reflector = get_ReflectionContext();
        YMLAttribute attr = (YMLAttribute)(reflector.get_Method().
            GetCustomAttribute(YMLAttribute.class.ToType()));
        // If the YMLAttribute has been applied to this XML Web service
 
        // method, add the XML defined in the YMLOperationBinding class.
        if (attr != null)  {
            YMLOperationBinding yml = new YMLOperationBinding();
            yml.set_Reverse(new Boolean(!(attr.get_Disabled())));
            //yml.set_Reverse( new Boolean(!(attr.get_Disabled())));
            reflector.get_OperationBinding().get_Extensions().Add(yml);
        }
    } //ReflectMethod
} //YMLReflector

// The YMLImporter class is part of the YML SDFE, as it is called when
 a
// proxy class is generated for each XML Web service method the proxy
 class
// communicates with. The class checks whether the service description
// contains the XML that this SDFE adds to a service description. If
 it 
// exists, then the YMLExtension is applied to the method in the proxy
 class.
/** @attribute System.Security.Permissions.PermissionSet(System.Security.
    Permissions.SecurityAction.Demand, Name = "FullTrust")
 */
public class YMLImporter extends SoapExtensionImporter
{
    public void ImportMethod(CodeAttributeDeclarationCollection
 metadata)
    {
        SoapProtocolImporter importer = get_ImportContext();
        // Check whether the XML specified in the YMLOperationBinding
 
        // is in the service description.
        YMLOperationBinding yml = (YMLOperationBinding)(importer.
            get_OperationBinding().get_Extensions().
            Find(YMLOperationBinding.class.ToType()));
        if (yml != null) {
            // Only apply the YMLAttribute to the method when the XML
 should
            // be reversed.
            if (System.Boolean.Parse(yml.get_Reverse().ToString()))
 {
                CodeAttributeDeclaration attr 
                    = new CodeAttributeDeclaration(YMLAttribute.class.ToType().
                    get_FullName());

                attr.get_Arguments().Add(new CodeAttributeArgument(new
                                         CodePrimitiveExpression((System.Boolean)true)));
                metadata.Add(attr);
            }
        }
    } //ImportMethod
} //YMLImporter

// The YMLOperationBinding class is part of the YML SDFE, as it is the
// class that is serialized into XML and is placed in the service
// description.
/** @attribute XmlFormatExtension("action", YMLOperationBinding.YMLNamespace,
 
    OperationBinding.class)
 */
/** @attribute XmlFormatExtensionPrefix("yml", YMLOperationBinding.YMLNamespace)
 */
public class YMLOperationBinding extends ServiceDescriptionFormatExtension
{
    private Boolean reverse;
    public final static String YMLNamespace
 = "http://www.contoso.com/yml";

    /** @attribute XmlElement("Reverse")
     */
    /** @property 
     */
    public Boolean get_Reverse()
    {
        return reverse;
    } //get_Reverse

    /** @property 
     */
    public void set_Reverse(Boolean value)
    {
        reverse = value;
    } //set_Reverse
} //YMLOperationBinding
継承階層継承階層
System.Object
   System.Attribute
    System.Web.Services.Configuration.XmlFormatExtensionAttribute
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
XmlFormatExtensionAttribute メンバ
System.Web.Services.Configuration 名前空間
ServiceDescriptionFormatExtension
XmlFormatExtensionAttribute クラス
XmlFormatExtensionPointAttribute
XmlFormatExtensionPrefixAttribute

XmlFormatExtensionAttribute コンストラクタ ()

XmlFormatExtensionAttribute クラス新しインスタンス初期化します。

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

Dim instance As New XmlFormatExtensionAttribute
public XmlFormatExtensionAttribute ()
public:
XmlFormatExtensionAttribute ()
public XmlFormatExtensionAttribute ()
public function XmlFormatExtensionAttribute
 ()
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
XmlFormatExtensionAttribute クラス
XmlFormatExtensionAttribute メンバ
System.Web.Services.Configuration 名前空間

XmlFormatExtensionAttribute コンストラクタ (String, String, Type, Type, Type)

指定され拡張ポイント実行するときに追加する XML 要素名前空間指定する XmlFormatExtensionAttribute クラス新しインスタンス初期化します。

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

Public Sub New ( _
    elementName As String, _
    ns As String, _
    extensionPoint1 As Type, _
    extensionPoint2 As Type, _
    extensionPoint3 As Type _
)
Dim elementName As String
Dim ns As String
Dim extensionPoint1 As Type
Dim extensionPoint2 As Type
Dim extensionPoint3 As Type

Dim instance As New XmlFormatExtensionAttribute(elementName,
 ns, extensionPoint1, extensionPoint2, extensionPoint3)
public XmlFormatExtensionAttribute (
    string elementName,
    string ns,
    Type extensionPoint1,
    Type extensionPoint2,
    Type extensionPoint3
)
public:
XmlFormatExtensionAttribute (
    String^ elementName, 
    String^ ns, 
    Type^ extensionPoint1, 
    Type^ extensionPoint2, 
    Type^ extensionPoint3
)
public XmlFormatExtensionAttribute (
    String elementName, 
    String ns, 
    Type extensionPoint1, 
    Type extensionPoint2, 
    Type extensionPoint3
)
public function XmlFormatExtensionAttribute
 (
    elementName : String, 
    ns : String, 
    extensionPoint1 : Type, 
    extensionPoint2 : Type, 
    extensionPoint3 : Type
)

パラメータ

elementName

サービス記述形式拡張機能によってサービス説明追加されXML 要素

ns

サービス記述形式拡張機能によってサービス説明追加されXML 要素XML 名前空間

extensionPoint1

サービス記述形式拡張機能実行する拡張ポイント

extensionPoint2

サービス記述形式拡張機能実行する拡張ポイント

extensionPoint3

サービス記述形式拡張機能実行する拡張ポイント

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

XmlFormatExtensionAttribute コンストラクタ (String, String, Type, Type, Type, Type)

指定され拡張ポイント実行するときに追加する XML 要素名前空間指定する XmlFormatExtensionAttribute クラス新しインスタンス初期化します。

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

Public Sub New ( _
    elementName As String, _
    ns As String, _
    extensionPoint1 As Type, _
    extensionPoint2 As Type, _
    extensionPoint3 As Type, _
    extensionPoint4 As Type _
)
Dim elementName As String
Dim ns As String
Dim extensionPoint1 As Type
Dim extensionPoint2 As Type
Dim extensionPoint3 As Type
Dim extensionPoint4 As Type

Dim instance As New XmlFormatExtensionAttribute(elementName,
 ns, extensionPoint1, extensionPoint2, extensionPoint3, extensionPoint4)
public XmlFormatExtensionAttribute (
    string elementName,
    string ns,
    Type extensionPoint1,
    Type extensionPoint2,
    Type extensionPoint3,
    Type extensionPoint4
)
public:
XmlFormatExtensionAttribute (
    String^ elementName, 
    String^ ns, 
    Type^ extensionPoint1, 
    Type^ extensionPoint2, 
    Type^ extensionPoint3, 
    Type^ extensionPoint4
)
public XmlFormatExtensionAttribute (
    String elementName, 
    String ns, 
    Type extensionPoint1, 
    Type extensionPoint2, 
    Type extensionPoint3, 
    Type extensionPoint4
)
public function XmlFormatExtensionAttribute
 (
    elementName : String, 
    ns : String, 
    extensionPoint1 : Type, 
    extensionPoint2 : Type, 
    extensionPoint3 : Type, 
    extensionPoint4 : Type
)

パラメータ

elementName

サービス記述形式拡張機能によってサービス説明追加されXML 要素

ns

サービス記述形式拡張機能によってサービス説明追加されXML 要素XML 名前空間

extensionPoint1

サービス記述形式拡張機能実行する拡張ポイント

extensionPoint2

サービス記述形式拡張機能実行する拡張ポイント

extensionPoint3

サービス記述形式拡張機能実行する拡張ポイント

extensionPoint4

サービス記述形式拡張機能実行する拡張ポイント

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

XmlFormatExtensionAttribute コンストラクタ (String, String, Type)

指定され拡張ポイント実行するときに追加する XML 要素名前空間指定する XmlFormatExtensionAttribute クラス新しインスタンス初期化します。

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

Public Sub New ( _
    elementName As String, _
    ns As String, _
    extensionPoint1 As Type _
)
Dim elementName As String
Dim ns As String
Dim extensionPoint1 As Type

Dim instance As New XmlFormatExtensionAttribute(elementName,
 ns, extensionPoint1)
public XmlFormatExtensionAttribute (
    string elementName,
    string ns,
    Type extensionPoint1
)
public:
XmlFormatExtensionAttribute (
    String^ elementName, 
    String^ ns, 
    Type^ extensionPoint1
)
public XmlFormatExtensionAttribute (
    String elementName, 
    String ns, 
    Type extensionPoint1
)
public function XmlFormatExtensionAttribute
 (
    elementName : String, 
    ns : String, 
    extensionPoint1 : Type
)

パラメータ

elementName

サービス記述形式拡張機能によってサービス説明追加されXML 要素

ns

サービス記述形式拡張機能によってサービス説明追加されXML 要素XML 名前空間

extensionPoint1

サービス記述形式拡張機能実行する拡張ポイント

使用例使用例
' The YMLOperationBinding class is part of the YML SDFE, as it is the
' class that is serialized into XML and is placed in the service
' description.
<XmlFormatExtension("action", YMLOperationBinding.YMLNamespace,
 _
    GetType(OperationBinding)), _
    XmlFormatExtensionPrefix("yml", YMLOperationBinding.YMLNamespace)>
 _
Public Class YMLOperationBinding
    Inherits ServiceDescriptionFormatExtension
    Private _reverse As Boolean
    Public Const YMLNamespace As
 String = "http://www.contoso.com/yml"

    <XmlElement("Reverse")> _
    Public Property Reverse() As
 Boolean
        Get
            Return _reverse
        End Get
        Set(ByVal Value As
 Boolean)
            _reverse = Value
        End Set
    End Property

End Class
// The YMLOperationBinding class is part of the YML SDFE, as it is the
// class that is serialized into XML and is placed in the service
// description.
[XmlFormatExtension("action", YMLOperationBinding.YMLNamespace, 
    typeof(OperationBinding))]
[XmlFormatExtensionPrefix("yml", YMLOperationBinding.YMLNamespace)]
public class YMLOperationBinding : ServiceDescriptionFormatExtension
 
{
    private Boolean reverse;

    public const string
 YMLNamespace = "http://www.contoso.com/yml";

    [XmlElement("Reverse")]
    public Boolean Reverse 
    {
        get { return reverse; }
        set { reverse = value; }
    }
}
// The YMLOperationBinding class is part of the YML SDFE, as it is the
// class that is serialized into XML and is placed in the service
// description.
/** @attribute XmlFormatExtension("action", YMLOperationBinding.YMLNamespace,
 
    OperationBinding.class)
 */
/** @attribute XmlFormatExtensionPrefix("yml", YMLOperationBinding.YMLNamespace)
 */
public class YMLOperationBinding extends ServiceDescriptionFormatExtension
{
    private Boolean reverse;
    public final static String YMLNamespace
 = "http://www.contoso.com/yml";

    /** @attribute XmlElement("Reverse")
     */
    /** @property 
     */
    public Boolean get_Reverse()
    {
        return reverse;
    } //get_Reverse

    /** @property 
     */
    public void set_Reverse(Boolean value)
    {
        reverse = value;
    } //set_Reverse
} //YMLOperationBinding
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
XmlFormatExtensionAttribute クラス
XmlFormatExtensionAttribute メンバ
System.Web.Services.Configuration 名前空間

XmlFormatExtensionAttribute コンストラクタ (String, String, Type[])

指定され拡張ポイント実行するときに追加する XML 要素名前空間指定する XmlFormatExtensionAttribute クラス新しインスタンス初期化します。

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

Public Sub New ( _
    elementName As String, _
    ns As String, _
    extensionPoints As Type() _
)
Dim elementName As String
Dim ns As String
Dim extensionPoints As Type()

Dim instance As New XmlFormatExtensionAttribute(elementName,
 ns, extensionPoints)
public XmlFormatExtensionAttribute (
    string elementName,
    string ns,
    Type[] extensionPoints
)
public:
XmlFormatExtensionAttribute (
    String^ elementName, 
    String^ ns, 
    array<Type^>^ extensionPoints
)
public XmlFormatExtensionAttribute (
    String elementName, 
    String ns, 
    Type[] extensionPoints
)
public function XmlFormatExtensionAttribute
 (
    elementName : String, 
    ns : String, 
    extensionPoints : Type[]
)

パラメータ

elementName

サービス記述形式拡張機能によってサービス説明追加されXML 要素

ns

サービス記述形式拡張機能によってサービス説明追加されXML 要素XML 名前空間

extensionPoints

サービス記述形式拡張機能実行する拡張ポイント配列

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

XmlFormatExtensionAttribute コンストラクタ

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

参照参照

関連項目

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

XmlFormatExtensionAttribute コンストラクタ (String, String, Type, Type)

指定され拡張ポイント実行するときに追加する XML 要素名前空間指定する XmlFormatExtensionAttribute クラス新しインスタンス初期化します。

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

Public Sub New ( _
    elementName As String, _
    ns As String, _
    extensionPoint1 As Type, _
    extensionPoint2 As Type _
)
Dim elementName As String
Dim ns As String
Dim extensionPoint1 As Type
Dim extensionPoint2 As Type

Dim instance As New XmlFormatExtensionAttribute(elementName,
 ns, extensionPoint1, extensionPoint2)
public XmlFormatExtensionAttribute (
    string elementName,
    string ns,
    Type extensionPoint1,
    Type extensionPoint2
)
public:
XmlFormatExtensionAttribute (
    String^ elementName, 
    String^ ns, 
    Type^ extensionPoint1, 
    Type^ extensionPoint2
)
public XmlFormatExtensionAttribute (
    String elementName, 
    String ns, 
    Type extensionPoint1, 
    Type extensionPoint2
)
public function XmlFormatExtensionAttribute
 (
    elementName : String, 
    ns : String, 
    extensionPoint1 : Type, 
    extensionPoint2 : Type
)

パラメータ

elementName

サービス記述形式拡張機能によってサービス説明追加されXML 要素

ns

サービス記述形式拡張機能によってサービス説明追加されXML 要素XML 名前空間

extensionPoint1

サービス記述形式拡張機能実行する拡張ポイント

extensionPoint2

サービス記述形式拡張機能実行する拡張ポイント

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

XmlFormatExtensionAttribute プロパティ


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

参照参照

関連項目

XmlFormatExtensionAttribute クラス
System.Web.Services.Configuration 名前空間
ServiceDescriptionFormatExtension
XmlFormatExtensionAttribute クラス
XmlFormatExtensionPointAttribute
XmlFormatExtensionPrefixAttribute

XmlFormatExtensionAttribute メソッド


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

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

関連項目

XmlFormatExtensionAttribute クラス
System.Web.Services.Configuration 名前空間
ServiceDescriptionFormatExtension
XmlFormatExtensionAttribute クラス
XmlFormatExtensionPointAttribute
XmlFormatExtensionPrefixAttribute

XmlFormatExtensionAttribute メンバ

サービス記述形式拡張機能1 つ上の拡張ポイント実行することを指定します。このクラス継承できません。

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


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

関連項目

XmlFormatExtensionAttribute クラス
System.Web.Services.Configuration 名前空間
ServiceDescriptionFormatExtension
XmlFormatExtensionAttribute クラス
XmlFormatExtensionPointAttribute
XmlFormatExtensionPrefixAttribute


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

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

辞書ショートカット

すべての辞書の索引

「XmlFormatExtensionAttribute」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS