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. SoapFormatter^ formatter = gcnew SoapFormatter();array<Byte>^ buffer = gcnew
array<Byte>(dept->Capacity);MemoryStream^ stream = gcnew MemoryStream(buffer);
for each (Object^ o in dept) {
formatter->Serialize(stream, o);}
B. SoapFormatter^ formatter = gcnew SoapFormatter();array<Byte>^ buffer = gcnew
array<Byte>(dept->Capacity);MemoryStream^ stream = gcnew MemoryStream(buffer);
formatter->Serialize(stream, dept);
C. SoapFormatter^ formatter = gcnew SoapFormatter();MemoryStream^ stream = gcnew
MemoryStream();for each (Object^ o in dept) {
formatter->Serialize(stream, o);}
D. SoapFormatter^ formatter = gcnew SoapFormatter();MemoryStream^ stream = gcnew
MemoryStream();formatter->Serialize(stream, dept);
Answer: D
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. SoapFormatter^ formatter = gcnew SoapFormatter();array<Byte>^ buffer = gcnew
array<Byte>(dept->Capacity);MemoryStream^ stream = gcnew MemoryStream(buffer);
for each (Object^ o in dept) {
formatter->Serialize(stream, o);}
B. SoapFormatter^ formatter = gcnew SoapFormatter();array<Byte>^ buffer = gcnew
array<Byte>(dept->Capacity);MemoryStream^ stream = gcnew MemoryStream(buffer);
formatter->Serialize(stream, dept);
C. SoapFormatter^ formatter = gcnew SoapFormatter();MemoryStream^ stream = gcnew
MemoryStream();for each (Object^ o in dept) {
formatter->Serialize(stream, o);}
D. SoapFormatter^ formatter = gcnew SoapFormatter();MemoryStream^ stream = gcnew
MemoryStream();formatter->Serialize(stream, dept);
Answer: D
No comments:
Post a Comment