What is the service?
Services are a group of methods that share a common set of requirements and functional goals. They are called by other parts that need to execute its logic, depending on the outcome (such as data, results of calculations, and so on).
Service is the combination of Channel, Protocol, Message, Policy, Schema and Contract
What is SOA ?
SOA is service oriented architecture. It is style of programming, an architectural approach in software development, where the application is organized in functional units of code with a given behavior called services.
SOA is a way to build distributed systems where autonomous logic is called using loosely coupled messages via a well defined interface.
Four Tenets of SOA
1. Boundaries are explicit
Boundaries are explicit means client only needs to be aware of the existence of function in the service that can only be executed via the contract.
2. Services are autonomous
Services are autonomous means
• Services should not dependent on the behavior of the other service.
• Services should be deployed and versioning independently.
• Service shouldn’t be coupled to each other as classes are coupled.
3.Services share schema and contract, not class
Schema is the definition of service operation and describes the signature of function. I.e. the name of function, type of parameters, and the type of return values. Service should not share the code of class to other parties.
4.Service compatibility is based on policy
A policy is used to negotiate elements in communication, such as message format and security requirement
Message Exchange pattern in WCF ?
These are the message pattern in WCF
The most commonly used pattern. The client request message from service by sending a request message and expect the response message from service. This means the service has to be reachable and
the client waits for the answer for a defined time.
2. One way
Messages are sent from client to server in one direction. The client sends a message but doesn’t expect an answer back.
3. Duplex Messaging
In the duplex pattern, client and server exchange messages without a predefined pattern. The client sends an initial request to the service waiting for a response but allows the service that sends the response to call back to the client to ask for more information. The service can call back to the client dynamically and possibly multiple times before sending the response to the initial request.
In the streaming pattern the client initiates a request to get a very large set of data. The service chunks up the data in smaller pieces and sends them to the client one by one. The data is so big that the service has to read this data from a file system or database in chunks. The data chunks are sent to the client in an ordered way as the receiver wants to consume them in that same ordered way. This would be the case in streaming video.
In the pub – sub pattern the publisher is typically unaware who the subscribers are and what they are doing with the received data. The publisher doesn’t even care whether there are subscribers.
The publisher just cares about sending data out of its system.