You create a Windows Communication Foundation service by using Microsoft .NET Framework 3.5.
You write the following code segment for the service implementation.
(Line numbers are included for reference only.)
01 public void PutMessage(Message msg)
02 {
03 string value=null;
04
05 }
You need to retrieve the content from the received message body and store it in the variable named value.
Which code segment should you insert at line 04?
A.
value = msg.Getbody<string>();
B.
string ns = msg.Headers.GetHeader<string>(0);
value = msg.GetbodyAttribute("Body", ns);
C.
XmlReader reader = msg.Getbody<XmlReader>();
value = reader.ReadOuterXml();
D.
XmlReader reader = msg.GetReaderAtbodyContents();
value = reader.ReadOuterXml();