You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/framework/wcf/feature-details/serialization-and-deserialization.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -257,7 +257,7 @@ manager: "erikre"
257
257
258
258
- The <xref:System.Runtime.Serialization.NetDataContractSerializer.Serialize%2A> and <xref:System.Runtime.Serialization.NetDataContractSerializer.Deserialize%2A> methods are aliases for the <xref:System.Runtime.Serialization.XmlObjectSerializer.WriteObject%2A> and <xref:System.Runtime.Serialization.XmlObjectSerializer.ReadObject%2A> methods. These exist to provide a more consistent programming model with binary or SOAP serialization.
259
259
260
-
[!INCLUDE[crabout](../../../../includes/crabout-md.md)] these features, see [Binary Serialization](../../../../docs/framework/serialization/binary-serialization.md).
260
+
[!INCLUDE[crabout](../../../../includes/crabout-md.md)] these features, see [Binary Serialization](../../../../docs/standard/serialization/binary-serialization.md).
261
261
262
262
The XML formats that the `NetDataContractSerializer` and the `DataContractSerializer` use are normally not compatible. That is, attempting to serialize with one of these serializers and deserialize with the other is not a supported scenario.
Copy file name to clipboardExpand all lines: docs/standard/serialization/attributes-that-control-encoded-soap-serialization.md
+10-10
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: "Attributes That Control Encoded SOAP Serialization"
3
3
ms.custom: ""
4
4
ms.date: "03/30/2017"
5
-
ms.prod: ".net-framework"
5
+
ms.prod: ".net"
6
6
ms.reviewer: ""
7
7
ms.suite: ""
8
8
ms.tgt_pltfrm: ""
@@ -24,10 +24,10 @@ author: "Erikre"
24
24
ms.author: "erikre"
25
25
manager: "erikre"
26
26
---
27
-
# Attributes That Control Encoded SOAP Serialization
28
-
The World Wide Web Consortium (www.w3.org) document named "Simple Object Access Protocol (SOAP) 1.1" contains an optional section (section 5) that describes how SOAP parameters can be encoded. To conform to section 5 of the specification, you must use a special set of attributes found in the <xref:System.Xml.Serialization> namespace. Apply those attributes as appropriate to classes and members of classes, and then use the [XmlSerializer](https://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx) to serialize instances of the class or classes.
27
+
# Attributes That Control Encoded SOAP Serialization
28
+
The World Wide Web Consortium (www.w3.org) document named "Simple Object Access Protocol (SOAP) 1.1" contains an optional section (section 5) that describes how SOAP parameters can be encoded. To conform to section 5 of the specification, you must use a special set of attributes found in the <xref:System.Xml.Serialization> namespace. Apply those attributes as appropriate to classes and members of classes, and then use the <xref:System.Xml.Serialization.XmlSerializer> to serialize instances of the class or classes.
29
29
30
-
The following table shows the attributes, where they can be applied, and what they do. For more information about using these attributes to control XML serialization, see [How to: Serialize an Object as a SOAP-Encoded XML Stream](../../../docs/framework/serialization/how-to-serialize-an-object-as-a-soap-encoded-xml-stream.md) and [How to: Override Encoded SOAP XML Serialization](../../../docs/framework/serialization/how-to-override-encoded-soap-xml-serialization.md).
30
+
The following table shows the attributes, where they can be applied, and what they do. For more information about using these attributes to control XML serialization, see [How to: Serialize an Object as a SOAP-Encoded XML Stream](../../../docs/standard/serialization/how-to-serialize-an-object-as-a-soap-encoded-xml-stream.md) and [How to: Override Encoded SOAP XML Serialization](../../../docs/standard/serialization/how-to-override-encoded-soap-xml-serialization.md).
31
31
32
32
For more information about attributes, see [Attributes](../../../docs/standard/attributes/index.md).
33
33
@@ -41,10 +41,10 @@ The World Wide Web Consortium (www.w3.org) document named "Simple Object Access
41
41
|<xref:System.Xml.Serialization.SoapTypeAttribute>|Public class declarations.|The class should be serialized as an XML type.|
42
42
43
43
## See Also
44
-
[XML and SOAP Serialization](../../../docs/framework/serialization/xml-and-soap-serialization.md)
45
-
[How to: Serialize an Object as a SOAP-Encoded XML Stream](../../../docs/framework/serialization/how-to-serialize-an-object-as-a-soap-encoded-xml-stream.md)
46
-
[How to: Override Encoded SOAP XML Serialization](../../../docs/framework/serialization/how-to-override-encoded-soap-xml-serialization.md)
44
+
[XML and SOAP Serialization](../../../docs/standard/serialization/xml-and-soap-serialization.md)
45
+
[How to: Serialize an Object as a SOAP-Encoded XML Stream](../../../docs/standard/serialization/how-to-serialize-an-object-as-a-soap-encoded-xml-stream.md)
46
+
[How to: Override Encoded SOAP XML Serialization](../../../docs/standard/serialization/how-to-override-encoded-soap-xml-serialization.md)
Copy file name to clipboardExpand all lines: docs/standard/serialization/attributes-that-control-xml-serialization.md
+10-10
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: "Attributes That Control XML Serialization"
3
3
ms.custom: ""
4
4
ms.date: "03/30/2017"
5
-
ms.prod: ".net-framework"
5
+
ms.prod: ".net"
6
6
ms.reviewer: ""
7
7
ms.suite: ""
8
8
ms.tgt_pltfrm: ""
@@ -26,9 +26,9 @@ ms.author: "erikre"
26
26
manager: "erikre"
27
27
---
28
28
# Attributes That Control XML Serialization
29
-
You can apply the attributes in the following table to classes and class members to control the way in which the [XmlSerializer](https://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx) serializes or deserializes an instance of the class. To understand how these attributes control XML serialization, see [Controlling XML Serialization Using Attributes](../../../docs/framework/serialization/controlling-xml-serialization-using-attributes.md).
29
+
You can apply the attributes in the following table to classes and class members to control the way in which the <xref:System.Xml.Serialization.XmlSerializer> serializes or deserializes an instance of the class. To understand how these attributes control XML serialization, see [Controlling XML Serialization Using Attributes](../../../docs/standard/serialization/controlling-xml-serialization-using-attributes.md).
30
30
31
-
These attributes can also be used to control the literal style SOAP messages generated by an XML Web service. For more information about applying these attributes to an XML Web services method, see [XML Serialization with XML Web Services](../../../docs/framework/serialization/xml-serialization-with-xml-web-services.md).
31
+
These attributes can also be used to control the literal style SOAP messages generated by an XML Web service. For more information about applying these attributes to an XML Web services method, see [XML Serialization with XML Web Services](../../../docs/standard/serialization/xml-serialization-with-xml-web-services.md).
32
32
33
33
For more information about attributes, see [Attributes](../../../docs/standard/attributes/index.md).
34
34
@@ -50,12 +50,12 @@ You can apply the attributes in the following table to classes and class members
50
50
51
51
In addition to these attributes, which are all found in the <xref:System.Xml.Serialization> namespace, you can also apply the <xref:System.ComponentModel.DefaultValueAttribute> attribute to a field. The **DefaultValueAttribute** sets the value that will be automatically assigned to the member if no value is specified.
52
52
53
-
To control encoded SOAP XML serialization, see [Attributes That Control Encoded SOAP Serialization](../../../docs/framework/serialization/attributes-that-control-encoded-soap-serialization.md).
53
+
To control encoded SOAP XML serialization, see [Attributes That Control Encoded SOAP Serialization](../../../docs/standard/serialization/attributes-that-control-encoded-soap-serialization.md).
54
54
55
55
## See Also
56
-
[XML and SOAP Serialization](../../../docs/framework/serialization/xml-and-soap-serialization.md)
[Controlling XML Serialization Using Attributes](../../../docs/framework/serialization/controlling-xml-serialization-using-attributes.md)
59
-
[How to: Specify an Alternate Element Name for an XML Stream](../../../docs/framework/serialization/how-to-specify-an-alternate-element-name-for-an-xml-stream.md)
60
-
[How to: Serialize an Object](../../../docs/framework/serialization/how-to-serialize-an-object.md)
61
-
[How to: Deserialize an Object](../../../docs/framework/serialization/how-to-deserialize-an-object.md)
56
+
[XML and SOAP Serialization](../../../docs/standard/serialization/xml-and-soap-serialization.md)
57
+
<xref:System.Xml.Serialization.XmlSerializer>
58
+
[Controlling XML Serialization Using Attributes](../../../docs/standard/serialization/controlling-xml-serialization-using-attributes.md)
59
+
[How to: Specify an Alternate Element Name for an XML Stream](../../../docs/standard/serialization/how-to-specify-an-alternate-element-name-for-an-xml-stream.md)
60
+
[How to: Serialize an Object](../../../docs/standard/serialization/how-to-serialize-an-object.md)
61
+
[How to: Deserialize an Object](../../../docs/standard/serialization/how-to-deserialize-an-object.md)
This example uses a binary formatter to do the serialization. All you need to do is create an instance of the stream and the formatter you intend to use, and then call the **Serialize** method on the formatter. The stream and the object to serialize are provided as parameters to this call. Although it is not explicitly demonstrated in this example, all member variables of a class will be serialized—even variables marked as private. In this aspect, binary serialization differs from the [XMLSerializer Class](https://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx), which only serializes public fields. For information on excluding member variables from binary serialization, see [Selective Serialization](../../../docs/framework/serialization/selective-serialization.md).
49
+
This example uses a binary formatter to do the serialization. All you need to do is create an instance of the stream and the formatter you intend to use, and then call the **Serialize** method on the formatter. The stream and the object to serialize are provided as parameters to this call. Although it is not explicitly demonstrated in this example, all member variables of a class will be serialized—even variables marked as private. In this aspect, binary serialization differs from the <xref:System.Xml.Serialization.XmlSerializer> class, which only serializes public fields. For information on excluding member variables from binary serialization, see [Selective Serialization](../../../docs/standard/serialization/selective-serialization.md).
50
50
51
51
Restoring the object back to its former state is just as easy. First, create a stream for reading and a <xref:System.Runtime.Serialization.Formatter>, and then instruct the formatter to deserialize the object. The code example below shows how this is done.
52
52
@@ -96,8 +96,8 @@ public class MyStuff : MyObject
96
96
}
97
97
```
98
98
99
-
Using the **Serializable** attribute is convenient, but it has limitations as demonstrated above. Refer to the [Serialization Guidelines](../../../docs/framework/serialization/serialization-guidelines.md) for information about when you should mark a class for serialization; serialization cannot be added to a class after it has been compiled.
99
+
Using the **Serializable** attribute is convenient, but it has limitations as demonstrated above. Refer to the [Serialization Guidelines](../../../docs/standard/serialization/serialization-guidelines.md) for information about when you should mark a class for serialization; serialization cannot be added to a class after it has been compiled.
0 commit comments