I hope the article WCF Architecture helped you to understand how all the various layers working together. One of the layers discussed was the Messaging Layer, which defines what formats and data exchange patterns can be used when communicating with services. This article discuss what a Message is and about the Message Structures.
Messages
A message is a packet of data containing several pieces of important information being routed from a source to a destination. It's a simple definition, so how will we relate it to WCF? Applications written using the WCF communicate through messages that are sent from a Point A to Point B (source to destination). All messages are formatted in XML.
Message Structure
WCF uses messages to pass data or exchange information from one point to another. All messages are SOAP messages. The basic structures of a SOAP message are made up of three components.
- SOAP Envelope
This is the outermost component of a SOAP message. The SOAP envelope is a container for the two most important pieces of a SOAP message, the SOAP header and the SOAP body. A SOAP envelope contains several pieces of key information in the form of elements. They includes: The name of the envelope, a namespace name, an optional <header> element, a required <body> element. Check the figure below and an example.
- SOAP Header
It is a collection of zero or more header blocks, i.e. a SOAP message can contain no headers or have collection of headers. So it's optional, if included then it must be the first child element of the SOAP envelop. Using a SOAP header, we can pass useful information about the services to the outer world if needed; it's just for information sharing. Any child elements of the header element are called "header blocks". This provides a mechanism for grouping logical data together.
- SOAP Body
This element contains the actual SOAP message for communication with the SOAP receiver, a message can contain zero or more bodies. Any information intended to be exchanged when the message reaches the intended destination goes in the message body. In simple terms the SOAP body contains the response for the client request.









Akiii LethalPosted Jun 6, 2012, 6:51 AM
good description, thanks !
KayleighPosted Feb 22, 2011, 11:30 PM
Very good work...looking forward for your next post!
SapnaPosted Feb 16, 2011, 11:01 PM
Your encouragement will make this site better..!great job.