First, the definition of WCF and WebService is summarized, and then the advantages of WCF are introduced. Finally, the fundamental differences between WCF and WebService are compared. The specific content is as follows
1. Definition
:Strictly speaking, it is an industry standard, not a technology, and uses XML extension markup language to represent data (this is the key to exaggerating language and platform). Microsoft's web service implementation is called Web Service. It uses Soap simple object access protocol to implement data interaction between applications in a distributed environment. WSDL to implement service interface related description. In addition, Web services can be registered in the UDDI center for its customers to find and use. Later, Microsoft made many extensions to Web Service in security, performance, data encryption, decryption, hosting, etc., called the WSE series. This is an excessive product, up to WSE3.0. Later it was the WCF era.
:In fact, it is Web Service to a certain extent. Because it supports the industry standards and core protocols of Web Service, it is almost competent for what Web Service and WSE can do, and it is not a problem across platforms and languages (the data also supports XML formatting and provides its own formatter).
However, as Microsoft's main promotion of a communication component or platform, WCF's goal is not only to support and integrate Web Service, because it is also compatible with and possesses many of Microsoft's early technologies.
According to Microsoft's official explanation,WCF (previous version named "Indigo")It is a unified framework for using managed code to build and run service-oriented applications. It enables developers to build a cross-platform secure, trustworthy, transactional solution that can be compatible with existing systems. WCF is an integrator of Microsoft's distributed application development. It integrates all distributed system-related technologies under the .Net platform, such as Enterprise Services (COM+).Net Remoting, Web Service (ASMX), WSE3.0 and MSMQ message queues. In terms of communication, it can cross processes, machines, subnets, enterprise networks and even the Internet; in terms of host programs, it can use EXE, WPF, Windows Forms, NT Service, COM+ as hosts (Host). The protocols that WCF can support include TCP, HTTP, cross-process and customization, and the security mode includes SAML, Kerberos, X509, user/password, customization and other standards and modes. In other words, under the WCF framework, it has become easy to develop a distributed system based on SOA. Microsoft includes all relevant technical elements. Mastering WCF is equivalent to mastering the key to opening the SOA door.
2. Advantages of WCF
1. UnityAs mentioned earlier, WCF is an integration of technologies such as ASMX, .Net Remoting, Enterprise Service, WSE, MSMQ, etc. Since WCF is written entirely in managed code, there is not much difference between developing WCF applications and developing other .Net applications. We can still use WCF to create service-oriented applications like we create object-oriented applications.
2. InteroperabilitySince the most basic communication mechanism of WCF is SOAP (Simple Object Access Protocol), this ensures interoperability between systems, even in different contexts. This communication can be based on communication between .Net to .Net, as shown in the figure below: Communication can be across processes, across machines and even across platforms, as long as standard Web Services are supported, such as J2EE application servers (such as WebSphere, WebLogic). Applications can run under Windows operating system, or on other operating systems, such as Sun Solaris, HP Unix, Linux, etc. As shown in the figure below:
3. Safety and trustworthinessWS-Security, WS-Trust and WS-SecureConversation are all added to SOAP messages for multiple security factors such as user authentication, data integrity verification, data privacy, etc. Added WS-ReliableMessaging to allow trusted end-to-end communication in SOAP's header. Information based on SOAP format exchange based on WS-Coordination and WS-AtomicTransaction supports two-phase commit transactions.
The above-mentioned WS-Policy supports it in WCF. For Messaging, SOAP is the basic protocol of Web Service, which includes a message header and a message body. In the message header, WS-Addressing is defined for locating the address information of SOAP messages, and also includes MTOM (Message Transmission Optimization Mechanism).
4. CompatibilityWCF fully takes into account compatibility with older systems. Installing WCF will not affect the original technologies such as ASMX and .Net Remoting. Even for WCF and ASMX, although both use SOAP, applications developed based on WCF can still interact directly with ASMX.
3. More difference
WCF supports multiple communication protocols: Http/Https, TCP/UDP, MSMQ, named pipelines, peer networks, message accessibility, transaction flow, etc.
WCF can integrate with and share a context (HttpContext).
WCF supports multiple message transmission formats: text, binary, mtom, Json, etc.
WCF has strong security: supports symmetric security, asymmetric security, message security, transmission security, SSL stream security, Windows stream security, etc.
WCF supports multiple session modes: one-way, two-way, request/response.
WCF supports REST.
WCF supports multiple formatting methods. DataContractSerializer, XmlSerializer, DataContractJsonSerializer, etc.
WCF supports WAS hosting, Windows service hosting, Self-Hosting, IIS hosting, etc.
WCF supports multiple concurrency modes: singleton, monotonous, and session.
The above is all about this article, I hope it will be helpful to everyone's learning.