WCF services writing and consuming related basic points are as in short -
- Service : A service is a unit of functionality, available to the world on some contract or deal.
- Client : A Client is nothing but a service consuming party. It uses the required protocols to consume/use the exposed services.
- Message Exchange Pattern : Communication between these Service & Client is made through messages. These messages are designed on some rules/patterns. There are 3 category of message exchange patterns -
- Request/Response ( this is the default format)
- One Way
- Duplex
- Serialization : A communication between service and client is done on internet. A complex object type data is directly not transport over the internet but it is converted into a transferable/transportable format. This conversion process is known as Serialization. There are 2 main way of doing this -
- Opt-in ( this is the default approach)
- Opt-out
- WCF services Hosting : Hosting of WCF service is required before using the service. For hosting, we need -
- a managed process
- a service host instance and
- a well configured endpoint
- Hosting approaches : There are 2 category mainly -
- in managed application ( this is also known as - Self Hosting )
- on web server 2.1 ) IIS and 2.2) WAS
- Steps to create and consume a WCF service : There are mainly 6 steps to create a new WCF service and how to consume this service from client. There are as below -
- Define a service contract
- Implement this defined contract
- Host the service, so that it can be consumed or used by clients
- Creating a client proxy
- Configuring client application to consume the service
- Call the service operation that is exposed by service using the created client proxy