IntroductionIn my previous article ( ABC of WCF ) I have given some brief idea about the basic concept of WCF.
Here we will see how the message is passed between the client and the service.
Different modes of message transmission and how it works.
Behind The SceneWhile, we are talking about WCF, we should keep in mind that there is two separate parts in WCF programing. One is client and another is service. And in order to access the service the client needs to send some message to the service with some argument in a certain format, that is described in the
binding section of the service.
This messaging layer defines in what format and patterns the data is exchanged between client and service.
|Client - Service Communication|
A message is a packet of data, that is transmitted from the client to the service and vice versa in a secure manner. The messages are formatted in XML.
WCF meassages are generally SOAP( simple object access protocol ) messages. Here I am giving you brief idea about the SOAP messages.
The SOAP message contains three parts such as
- SOAP Envelope
- SOAP Header
- SOAP Body
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.
<?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap-envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"> <soap:Header> This is just for Information to outer world </soap:Header> <soap:Body> Message goes here </soap:Body> </soap:Envelope>
In WCF there the messages can be sent from a client to a service, from a service to a client and from a service to a service.
|Request Reply Messaging|