Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Message::GetBody Method

 

Retrieves the body of this Message instance.

Namespace:   System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

NameDescription
System_CAPS_pubmethodGetBody<T>()

Retrieves the body of this Message instance.

System_CAPS_pubmethodGetBody<T>(XmlObjectSerializer^)

Retrieves the body of this Message using the specified serializer.

After a message is created, the message body can be read using the GetBody methods on the returned message. The returned object encapsulates all the child elements within the Body element. Because the body of a message is a stream, it can only be written once, or read once.

Use the GetBody<T>(XmlObjectSerializer^) overload when working with JSON messages; the GetBody<T>() overload does not work.

The following code example shows a client that uses the channel factory to send a message and read the reply.

No code example is currently available or this language may not be supported.
Return to top
Show:
© 2017 Microsoft