Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
403 lines (356 sloc) 27.8 KB
<Type Name="SoapTypeAttribute" FullName="System.Xml.Serialization.SoapTypeAttribute">
<TypeSignature Language="C#" Value="public class SoapTypeAttribute : Attribute" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit SoapTypeAttribute extends System.Attribute" />
<TypeSignature Language="DocId" Value="T:System.Xml.Serialization.SoapTypeAttribute" />
<TypeSignature Language="VB.NET" Value="Public Class SoapTypeAttribute&#xA;Inherits Attribute" />
<TypeSignature Language="C++ CLI" Value="public ref class SoapTypeAttribute : Attribute" />
<TypeSignature Language="F#" Value="type SoapTypeAttribute = class&#xA; inherit Attribute" />
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.XmlSerializer</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Attribute</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute FrameworkAlternate="netcore-2.0;netcore-2.1;netstandard-2.0;netcore-2.2;netstandard-2.1;netcore-3.0;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netcore-3.1">
<AttributeName>System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Struct)</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Controls the schema generated by the <see cref="T:System.Xml.Serialization.XmlSerializer" /> when a class instance is serialized as SOAP encoded XML.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Xml.Serialization.SoapTypeAttribute> class belongs to a family of attributes that controls how the <xref:System.Xml.Serialization.XmlSerializer> serializes or deserializes an object as encoded SOAP XML. The resulting XML conforms to section 5 of the World Wide Web Consortium document, [Simple Object Access Protocol (SOAP) 1.1](https://www.w3.org/TR/2000/NOTE-SOAP-20000508/). For a complete list of similar attributes, see [Attributes That Control Encoded SOAP Serialization](~/docs/standard/serialization/attributes-that-control-encoded-soap-serialization.md).
To serialize an object as an encoded SOAP message, construct the <xref:System.Xml.Serialization.XmlSerializer> using an <xref:System.Xml.Serialization.XmlTypeMapping> created with the <xref:System.Xml.Serialization.SoapReflectionImporter.ImportTypeMapping%2A> method of the <xref:System.Xml.Serialization.SoapReflectionImporter> class.
The <xref:System.Xml.Serialization.SoapTypeAttribute> can only be applied to class declarations.
The <xref:System.Xml.Serialization.SoapTypeAttribute.IncludeInSchema%2A> property determines whether the resulting XML element type is included in the XML Schema document (.xsd) for the generated XML stream. To see the schema, compile the class into a DLL file. Pass the resulting file as an argument to the [XML Schema Definition Tool (Xsd.exe)](~/docs/standard/serialization/xml-schema-definition-tool-xsd-exe.md). The tool generates the XML Schema for the XML stream generated when the class is serialized by an instance of the <xref:System.Xml.Serialization.XmlSerializer> class.
Setting a different namespace causes Xsd.exe to write a different schema (.xsd) file for the XML stream generated when the class is serialized.
## Examples
The following example serializes a class named `Group`. The <xref:System.Xml.Serialization.SoapTypeAttribute> is applied to the class, with the <xref:System.Xml.Serialization.SoapTypeAttribute.TypeName%2A> set to "SoapGroupType". The <xref:System.Xml.Serialization.SoapTypeAttribute> is also overridden, changing the <xref:System.Xml.Serialization.SoapTypeAttribute.TypeName%2A> to "Team". Both versions are serialized, resulting in two files: SoapType.xml and SoapType2.xml.
[!code-cpp[SoapTypeAttribute Example#1](~/samples/snippets/cpp/VS_Snippets_Remoting/SoapTypeAttribute Example/CPP/soaptype.cpp#1)]
[!code-csharp[SoapTypeAttribute Example#1](~/samples/snippets/csharp/VS_Snippets_Remoting/SoapTypeAttribute Example/CS/soaptype.cs#1)]
[!code-vb[SoapTypeAttribute Example#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/SoapTypeAttribute Example/VB/soaptype.vb#1)]
]]></format>
</remarks>
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Xml.Serialization.SoapTypeAttribute" /> class.</summary>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public SoapTypeAttribute ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Serialization.SoapTypeAttribute.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; SoapTypeAttribute();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.XmlSerializer</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Xml.Serialization.SoapTypeAttribute" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Create a <xref:System.Xml.Serialization.SoapTypeAttribute> when overriding the serialization of a type. Assign the object to the <xref:System.Xml.Serialization.SoapAttributes.SoapType%2A> property of a <xref:System.Xml.Serialization.SoapAttributes> and add the <xref:System.Xml.Serialization.SoapAttributes> to a <xref:System.Xml.Serialization.SoapAttributeOverrides>. See the <xref:System.Xml.Serialization.SoapAttributeOverrides> class overview for more details about overriding SOAP serialization.
## Examples
The following example serializes a class named `Group`. The <xref:System.Xml.Serialization.SoapTypeAttribute> is applied to the class with the <xref:System.Xml.Serialization.SoapTypeAttribute.TypeName%2A> set to "SoapGroupType". The <xref:System.Xml.Serialization.SoapTypeAttribute> is also overridden, changing the <xref:System.Xml.Serialization.SoapTypeAttribute.TypeName%2A> to "Team". Both versions are serialized, resulting in two files: SoapType.xml and SoapType2.xml.
[!code-cpp[SoapTypeAttribute Example#1](~/samples/snippets/cpp/VS_Snippets_Remoting/SoapTypeAttribute Example/CPP/soaptype.cpp#1)]
[!code-csharp[SoapTypeAttribute Example#1](~/samples/snippets/csharp/VS_Snippets_Remoting/SoapTypeAttribute Example/CS/soaptype.cs#1)]
[!code-vb[SoapTypeAttribute Example#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/SoapTypeAttribute Example/VB/soaptype.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public SoapTypeAttribute (string typeName);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string typeName) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Serialization.SoapTypeAttribute.#ctor(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (typeName As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; SoapTypeAttribute(System::String ^ typeName);" />
<MemberSignature Language="F#" Value="new System.Xml.Serialization.SoapTypeAttribute : string -&gt; System.Xml.Serialization.SoapTypeAttribute" Usage="new System.Xml.Serialization.SoapTypeAttribute typeName" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.XmlSerializer</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="typeName" Type="System.String" />
</Parameters>
<Docs>
<param name="typeName">The name of the XML type that the <see cref="T:System.Xml.Serialization.XmlSerializer" /> generates when it serializes the class instance (and recognizes when it deserializes the class instance).</param>
<summary>Initializes a new instance of the <see cref="T:System.Xml.Serialization.SoapTypeAttribute" /> class and specifies the name of the XML type.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Create a <xref:System.Xml.Serialization.SoapTypeAttribute> when overriding the serialization of a type. Assign the object to the <xref:System.Xml.Serialization.SoapAttributes.SoapType%2A> property of a <xref:System.Xml.Serialization.SoapAttributes> and add the <xref:System.Xml.Serialization.SoapAttributes> to a <xref:System.Xml.Serialization.SoapAttributeOverrides>. See the <xref:System.Xml.Serialization.SoapAttributeOverrides> class overview for more details about overriding SOAP serialization.
## Examples
The following example serializes a class named `Group`. The <xref:System.Xml.Serialization.SoapTypeAttribute> is applied to the class with the <xref:System.Xml.Serialization.SoapTypeAttribute.TypeName%2A> set to "SoapGroupType". The <xref:System.Xml.Serialization.SoapTypeAttribute> is also overridden, changing the <xref:System.Xml.Serialization.SoapTypeAttribute.TypeName%2A> to "Team". Both versions are serialized, resulting in two files: SoapType.xml and SoapType2.xml.
[!code-cpp[SoapTypeAttribute Example#1](~/samples/snippets/cpp/VS_Snippets_Remoting/SoapTypeAttribute Example/CPP/soaptype.cpp#1)]
[!code-csharp[SoapTypeAttribute Example#1](~/samples/snippets/csharp/VS_Snippets_Remoting/SoapTypeAttribute Example/CS/soaptype.cs#1)]
[!code-vb[SoapTypeAttribute Example#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/SoapTypeAttribute Example/VB/soaptype.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public SoapTypeAttribute (string typeName, string ns);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string typeName, string ns) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Xml.Serialization.SoapTypeAttribute.#ctor(System.String,System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (typeName As String, ns As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; SoapTypeAttribute(System::String ^ typeName, System::String ^ ns);" />
<MemberSignature Language="F#" Value="new System.Xml.Serialization.SoapTypeAttribute : string * string -&gt; System.Xml.Serialization.SoapTypeAttribute" Usage="new System.Xml.Serialization.SoapTypeAttribute (typeName, ns)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.XmlSerializer</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="typeName" Type="System.String" />
<Parameter Name="ns" Type="System.String" />
</Parameters>
<Docs>
<param name="typeName">The name of the XML type that the <see cref="T:System.Xml.Serialization.XmlSerializer" /> generates when it serializes the class instance (and recognizes when it deserializes the class instance).</param>
<param name="ns">The XML namespace of the type.</param>
<summary>Initializes a new instance of the <see cref="T:System.Xml.Serialization.SoapTypeAttribute" /> class and specifies the name and XML namespace of the type.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Create a <xref:System.Xml.Serialization.SoapTypeAttribute> when overriding the serialization of a type. Assign the object to the <xref:System.Xml.Serialization.SoapAttributes.SoapType%2A> property of a <xref:System.Xml.Serialization.SoapAttributes> and add the <xref:System.Xml.Serialization.SoapAttributes> to a <xref:System.Xml.Serialization.SoapAttributeOverrides>. See the <xref:System.Xml.Serialization.SoapAttributeOverrides> class overview for more details on overriding SOAP serialization.
If you set a <xref:System.Xml.Serialization.SoapTypeAttribute.Namespace%2A> value for more than one type (that is, if you apply the attribute to more than one class with a different <xref:System.Xml.Serialization.SoapTypeAttribute.Namespace%2A> value for each one), the [XML Schema Definition Tool (Xsd.exe)](~/docs/standard/serialization/xml-schema-definition-tool-xsd-exe.md) generates a separate schema file (.xsd) for each type. This is because setting a different namespace for each type renders each type distinct from the others, which makes it necessary for each type to be written out as an independent entity.
## Examples
The following example serializes a class named `Group`. The <xref:System.Xml.Serialization.SoapTypeAttribute> is applied to the class with the <xref:System.Xml.Serialization.SoapTypeAttribute.TypeName%2A> set to "SoapGroupType". The <xref:System.Xml.Serialization.SoapTypeAttribute> is also overridden, changing the <xref:System.Xml.Serialization.SoapTypeAttribute.TypeName%2A> to "Team". Both versions are serialized, resulting in two files: SoapType.xml and SoapType2.xml.
[!code-cpp[SoapTypeAttribute Example#1](~/samples/snippets/cpp/VS_Snippets_Remoting/SoapTypeAttribute Example/CPP/soaptype.cpp#1)]
[!code-csharp[SoapTypeAttribute Example#1](~/samples/snippets/csharp/VS_Snippets_Remoting/SoapTypeAttribute Example/CS/soaptype.cs#1)]
[!code-vb[SoapTypeAttribute Example#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/SoapTypeAttribute Example/VB/soaptype.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="IncludeInSchema">
<MemberSignature Language="C#" Value="public bool IncludeInSchema { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IncludeInSchema" />
<MemberSignature Language="DocId" Value="P:System.Xml.Serialization.SoapTypeAttribute.IncludeInSchema" />
<MemberSignature Language="VB.NET" Value="Public Property IncludeInSchema As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property bool IncludeInSchema { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.IncludeInSchema : bool with get, set" Usage="System.Xml.Serialization.SoapTypeAttribute.IncludeInSchema" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.XmlSerializer</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value that indicates whether to include the type in SOAP-encoded XML Schema documents.</summary>
<value>
<see langword="true" /> to include the type in SOAP-encoded XML Schema documents; otherwise, <see langword="false" />. The default is <see langword="true" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Apply the <xref:System.Xml.Serialization.SoapTypeAttribute> to a class declaration to specify whether to include the type in the XML schema document. To see the results of setting the properties of the <xref:System.Xml.Serialization.SoapTypeAttribute> class, compile your application as an executable or DLL, and pass the resulting file to the [XML Schema Definition Tool (Xsd.exe)](~/docs/standard/serialization/xml-schema-definition-tool-xsd-exe.md). The tool writes the schema, including the type definition of the XML stream generated when the class is serialized.
## Examples
The following example serializes a class named `Group`. The <xref:System.Xml.Serialization.SoapTypeAttribute> is applied to the class with the <xref:System.Xml.Serialization.SoapTypeAttribute.TypeName%2A> set to "SoapGroupType". The <xref:System.Xml.Serialization.SoapTypeAttribute> is also overridden, changing the <xref:System.Xml.Serialization.SoapTypeAttribute.TypeName%2A> to "Team". Both versions are serialized, resulting in two files: SoapType.xml and SoapType2.xml.
[!code-cpp[SoapTypeAttribute Example#1](~/samples/snippets/cpp/VS_Snippets_Remoting/SoapTypeAttribute Example/CPP/soaptype.cpp#1)]
[!code-csharp[SoapTypeAttribute Example#1](~/samples/snippets/csharp/VS_Snippets_Remoting/SoapTypeAttribute Example/CS/soaptype.cs#1)]
[!code-vb[SoapTypeAttribute Example#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/SoapTypeAttribute Example/VB/soaptype.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Namespace">
<MemberSignature Language="C#" Value="public string Namespace { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Namespace" />
<MemberSignature Language="DocId" Value="P:System.Xml.Serialization.SoapTypeAttribute.Namespace" />
<MemberSignature Language="VB.NET" Value="Public Property Namespace As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ Namespace { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.Namespace : string with get, set" Usage="System.Xml.Serialization.SoapTypeAttribute.Namespace" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.XmlSerializer</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the namespace of the XML type.</summary>
<value>The namespace of the XML type. The default is an empty string ("").</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If you set a <xref:System.Xml.Serialization.SoapTypeAttribute.Namespace%2A> value for more than one type (that is, if you apply the attribute to more than one class with a different <xref:System.Xml.Serialization.SoapTypeAttribute.Namespace%2A> value for each one), the [XML Schema Definition Tool (Xsd.exe)](~/docs/standard/serialization/xml-schema-definition-tool-xsd-exe.md) generates a separate schema file (.xsd) for each type. This is because setting a different namespace for each type renders each type distinct from the others, which makes it necessary for each type to be written out as an independent entity.
## Examples
The following example serializes a class named `Group`. The <xref:System.Xml.Serialization.SoapTypeAttribute> is applied to the class with the <xref:System.Xml.Serialization.SoapTypeAttribute.TypeName%2A> set to "SoapGroupType". The <xref:System.Xml.Serialization.SoapTypeAttribute> is also overridden, changing the <xref:System.Xml.Serialization.SoapTypeAttribute.TypeName%2A> to "Team". Both versions are serialized, resulting in two files: SoapType.xml and SoapType2.xml.
[!code-cpp[SoapTypeAttribute Example#1](~/samples/snippets/cpp/VS_Snippets_Remoting/SoapTypeAttribute Example/CPP/soaptype.cpp#1)]
[!code-csharp[SoapTypeAttribute Example#1](~/samples/snippets/csharp/VS_Snippets_Remoting/SoapTypeAttribute Example/CS/soaptype.cs#1)]
[!code-vb[SoapTypeAttribute Example#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/SoapTypeAttribute Example/VB/soaptype.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="TypeName">
<MemberSignature Language="C#" Value="public string TypeName { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string TypeName" />
<MemberSignature Language="DocId" Value="P:System.Xml.Serialization.SoapTypeAttribute.TypeName" />
<MemberSignature Language="VB.NET" Value="Public Property TypeName As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ TypeName { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.TypeName : string with get, set" Usage="System.Xml.Serialization.SoapTypeAttribute.TypeName" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Xml</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Xml.XmlSerializer</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.1.2.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the name of the XML type.</summary>
<value>The name of the XML type. The default is the class name.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Apply the <xref:System.Xml.Serialization.SoapTypeAttribute> to a class to specify the XML type's namespace, the XML type name, and whether to include the type in the XML Schema document. To see the results of setting the <xref:System.Xml.Serialization.SoapTypeAttribute> object's properties, compile your application as an executable or DLL, and pass the resulting file to the [XML Schema Definition Tool (Xsd.exe)](~/docs/standard/serialization/xml-schema-definition-tool-xsd-exe.md). The tool writes the schema, including the type definition.
## Examples
The following example serializes a class named `Group`. The <xref:System.Xml.Serialization.SoapTypeAttribute> is applied to the class with the <xref:System.Xml.Serialization.SoapTypeAttribute.TypeName%2A> set to "SoapGroupType". The <xref:System.Xml.Serialization.SoapTypeAttribute> is also overridden, changing the <xref:System.Xml.Serialization.SoapTypeAttribute.TypeName%2A> to "Team". Both versions are serialized, resulting in two files: SoapType.xml and SoapType2.xml.
[!code-cpp[SoapTypeAttribute Example#1](~/samples/snippets/cpp/VS_Snippets_Remoting/SoapTypeAttribute Example/CPP/soaptype.cpp#1)]
[!code-csharp[SoapTypeAttribute Example#1](~/samples/snippets/csharp/VS_Snippets_Remoting/SoapTypeAttribute Example/CS/soaptype.cs#1)]
[!code-vb[SoapTypeAttribute Example#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/SoapTypeAttribute Example/VB/soaptype.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.