You are writing an application that uses SOAP to exchange data with other applications.

You are writing an application that uses SOAP to exchange data with other applications.
You use a Department class that inherits from ArrayList to send objects to another application.
The Department object is named dept.
You need to ensure that the application serializes the Department object for transport by using
SOAP. Which code should you use?

A. Dim formatter As New SoapFormatter()Dim buffer As Byte() = New
    Byte(dept.Capacity) {}Dim myStream As New MemoryStream(buffer) Dim o As
    ObjectFor Each o In dept
    formatter.Serialize(myStream, o)Next
B. Dim formatter As New SoapFormatter()Dim buffer As Byte() = New
    Byte(dept.Capacity)Dim myStream As New
    MemoryStream(buffer)formatter.Serialize(myStream, dept)
C. Dim formatter As New SoapFormatter()Dim myStream As New MemoryStream()Dim
    o as ObjectFor Each o In dept
    formatter.Serialize(myStream, o)Next
D. Dim formatter As New SoapFormatter()Dim myStream As New
    MemoryStream()formatter.Serialize(myStream, dept)

Answer: D

No comments:

Post a Comment