PrepAway - Latest Free Exam Questions & Answers

What should you do?

You are writing an application that creates network accounts for users.

The application monitors a private queue and it creates network accounts when messages arrive in that queue.
A message contains a User object.
The message is sent to the queue using the following code.

MessageQueue q = new MessageQueue(queueName);
Message m = new Message(new User(“anna”,”bedecs”));
q.Send(m, “create account”);

You need to ensure that the application can process the User object.
What should you do?

PrepAway - Latest Free Exam Questions & Answers

A.
Write the following code segment to get the User object.
q.ReceiveById(“User”);
m = q.Receive();
User u = m.Body as User;

B.
Write the following code segment to get the User object.
q.ReceiveById(“User”);m = q.Receive();
m.BodyType = 5;
User u = m.Body as User;

C.
Write the following code segment to get the User object.
q.Formatter = new XmlMessageFormatter(new Type[] { typeof(User) });
m = q.Receive();
User u = m.Body as User;

D.
Write the following code segment to get the User object.
q.Formatter = new XmlMessageFormatter();
m = q.Receive();
User u = m.Body as User;


Leave a Reply