WCF Learning Series-Basics of WCF Learning Series
This series of blogs is recorded by WCF4 advanced programming learning. If you have any errors, please correct them.
First, we will introduce some concepts:
SOA: (Service-Oriented Architecture Oriented Service Architecture), an Architecture method and a programming mode. The SOA architecture allows users to organize applications in a certain way. The basic idea of SOA is to build a loosely coupled system. the technical basis of the SOA architecture is the SOAP standard.
SOAP :( Simple Object Access Protocol), a data exchange Protocol, is a lightweight, Simple, XML-based (a subset of standard General Markup Language). The XML language is used to define the content of messages sent and received by a service operation. A soap contains a message header (optional) and a message body (required). The message header has nothing to do with the business, and the message body contains useful data.
XSD: XML Schema Definition)
WS-* Protocols: WS-* is a series of standard Protocols that specify how to implement a certain requirement and behavior when using distributed message transmission; describes how to implement secure, reliable, and transactional message exchange through the SOAP Header element.
WSDL: defines the XML format of the contract, including the metadata of the service interface, function name, parameter name, data type, and function return value type. The purpose of the WSDL document is to define the contract in a cross-platform manner because it is defined in XML format.
Principles of the SOAP architecture:
- 1. Boundary display definition: the process and memory space in the service runtime must be independent of the process and memory space of the client program that references the service. The client accesses the service through the address. Generally speaking, the client and service run in two completely different places, and the service tells the client address.
- 2. service automation: a service is an independent program module that does not rely on the behavior of other services. There is no coupling between services, and different versions of each service are independent of each other.
- 3. Services share modes and contracts, rather than implementation classes. A mode defines service operations and describes signatures in a platform-independent manner. A contract is the metadata of a service and the external interface of the service as a black box. My understanding is: clients and services share only interfaces, rather than specific implementation classes.
- 4. Policy-based service compatibility: that is to say, the Service decides to process messages sent by the client only when certain conditions are met. For example, the message format and security requirements must be configured using a policy.
Service ecosystem:
Composition of the SOA service Ecosystem
- 1. Applications are composed of services: the core of the entire system is services, and a complete application is built by modules composed of services.
- 2. Service Status Management: service tasks and operations are persistent data and data reading.
- 3. Service implementation strategy: the service yunquan formulates policies related to the service logic, and defines the preconditions for the service user behavior model. Most of the policies are security protocols.
- 4. Policy Implementation operation requirements: the client must implement a certain security policy to call the service.
- 5. The service is bound by the contract: the service exists only when the operation signature of the service description exists. The contract display definition is bound to the service at runtime.
- 6. The contract defines the message exchange mode: There are three types of message exchange modes:
1. Request-mode: The most common mode. messages are returned for each call.
2. unidirectional mode: the service does not return a structure and can be called asynchronously.
3. Bidirectional mode: Services and clients can be called by projects.
- 7. Contract inclusion mode, while the mode defines the structure of the message: the mode uses the XSD document format to describe the parameters. XSD is used to describe the parameters of the input service operation and the returned results.
- 8. The message exchange mode is a message set. The message combination and call sequence can be described in a more complex exchange mode. The message exchange mode defines which operation is called first and which operation is called later.
- 9. Service exchange information: The exchange information means to call an operation and receive the response from this operation. Exchange information, that is, one message transmits the input parameters of the client to the service, and the other message is sent to the caller.
This article introduces the components of basic SOA programs and the role of services in SOA programs. The next article introduces the basic content of WCF.