You need to ensure that Address instances that are serialized by the XmlSerializer class meet the XML format requirements of the external data service

You are implementing an ASP.NET Web site. The site contains the following class.
Public Class Address
Public AddressType As Integer
Public Line1 As String
Public Line2 As String
Public City As String
Public ZipPostalCode As String
End Class
The Web site interacts with an external data service that requires Address instances to be given in
the following XML format.
<Address AddressType=”2″>
<Line1>250 Race Court</Line1>
<City>Chicago</City>
<PostalCode>60603</PostalCode>
</Address>
You need to ensure that Address instances that are serialized by the XmlSerializer class meet the
XML format requirements of the external data service. Which two actions should you perform (Each
correct answer presents part of the solution. Choose two.)

You are implementing an ASP.NET Web site. The site contains the following class.
Public Class Address
Public AddressType As Integer
Public Line1 As String
Public Line2 As String
Public City As String
Public ZipPostalCode As String
End Class
The Web site interacts with an external data service that requires Address instances to be given in
the following XML format.
<Address AddressType=”2″>
<Line1>250 Race Court</Line1>
<City>Chicago</City>
<PostalCode>60603</PostalCode>
</Address>
You need to ensure that Address instances that are serialized by the XmlSerializer class meet the
XML format requirements of the external data service. Which two actions should you perform (Each
correct answer presents part of the solution. Choose two.)

A.
Add the following attribute to the AddressType field.
<XmlAttribute()>

B.
Add the following attribute to the Line2 field.
<XmlElement(IsNullable:=True)>

C.
Add the following attribute to the ZipPostalCode field.
<XmlAttribute(“ZipCode”)>

D.
Add the following attribute to the ZipPostalCode field.
<XmlElement(“ZipCode”)>

Explanation:
XmlSerializer Class
(http://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.aspx)



Leave a Reply 0

Your email address will not be published. Required fields are marked *