The difference between WCF and WebService

Source: Internet
Author: User
Tags hosting managed hosting msmq

1.WebService: Strictly industry standard, not technology, uses XML Extensible Markup Language to represent the data (this is the key to the Kua language and the platform). Microsoft's Web service implementations are called ASP. it uses Soap Simple Object Access Protocol to implement data interactions between applications in a distributed environment. WSDL to implement a service interface-related description. In addition , Web services can be registered with the UDDI Center . for their customers to find and use. Later, Microsoft made ASP. NET Web Service Security, performance, data encryption, decryption, managed hosting, and many other extensions, called WSE Series, this is over-product, up to WSE3.0. And then it was WCF times.

2.WCF: To some extent , ASP. NET Web service, because it supports the industry standards and core protocols of Web service , so What ASP. NET Web Service and WSE can do, it is almost competent, cross-platform and language is not a problem (the data also supports XML formatting,   And it provides its own formatter). But WCF , as Microsoft's main push for a communications component or platform, aims not only to support and integrate Web Service,  Because it is also compatible and has the features of many of Microsoft's early technologies.

According to Microsoft's official explanation,WCF(the previous version is named"Indigo") is to use managed code to establish and run a service-oriented (Service oriented) application's unified framework. It enables developers to build a secure, trustworthy, transactional solution across platforms that can be compatible with existing systems. WCFis the integrator of Microsoft's distributed application development, which integrates. Netall the technologies related to distributed systems under the platform, such asEnterprise sevices (COM +). Net Remoting,Web Service (ASMX),WSE3.0and theMSMQMessage Queuing. With communication(communiation)scope, it can cross-process, cross-machine, cross-subnet, enterprise network andInternetin the host program, you canASP,EXE,WPF,Windows Forms,NT Service,COM +as a host(Host). WCFThe protocols that can be supported includeTCP,HTTP, cross-process and custom, security mode includesSAML,Kerberos,X509, the user/Password, custom and many other standards and patterns. In other words,WCFFramework, the development is based onSOADistributed System, Microsoft has included all the technical elements associated with it, and has masteredWCF, it's the equivalent of mastering the openSOAthe key to the gate.

WCF has the following advantages:

1 , Unity   previously described, WCF yes for ASMX , . net remoting , Enterprise service , WSE , MSMQ Integration of technologies such as . Because WCF is written entirely by managed code, developing applications for WCF and developing other . Net there is not much difference in the application, we can still use the same as creating object-oriented applications, using the WCF to create a service-oriented application.

2 , interoperability   because WCF The most basic communication mechanism is SOAP ( simple object access protocol  Simple Object Access Protocol), which guarantees interoperability between systems, even in a different context. This communication can be based on the communication between the . NET and . NET , as shown:  can cross-process, cross-machine, and even cross-platform communications. As long as the standard web service is supported, such as java EE application server (such as WebSphere , WebLogic ). Applications can run under the Windows operating system, or they can run on other operating systems, such as sun solaris , Hp unix , Linux , and so on. : 

as shown

3 , secure and trustworthy   ws-security , ws-trust and ws-secureconversation are added to the SOAP message for user authentication. Data integrity verification, data privacy and many other security factors.   Added header in soap  Ws-reliablemessaging allows trustworthy end-to-end communication. Instead, the ws-coordination and ws- atomictransaction are built on the SOAP The format is exchanged for information, then two-stage transactional commits are supported ( two-phase commit transactions ).

Many of the above Ws-policy are supported in WCF . For Messaging ,SOAP is the basic protocol for Web Service , and it contains the message header ( Header) and the message body (body). In the message header, the address information that ws-addressing uses to locate the SOAP message is defined , along with the MTOM (message transfer optimization mechanism, Message transmission Optimization mechanism ). :

 4 , Compatibility WCF The compatibility with the old system is fully considered. Installing WCF does not affect legacy technologies such as ASMX and . Net Remoting. Even for WCF and ASMX , although both use SOAP, they are based on the applications that are developed by WCF can still interact directly with ASMX .

More The Difference

WCF supports multiple communication protocols Http/https ,tcp/udp,MSMQ, Named Pipes, Peers,

Messaging accessibility, transaction flow, and so on.

WCF can integrate with ASP , share a context (HttpContext).

WCF supports a variety of message transmission formats : Text,binary,mtom,json , and so on.

WCF security is stronger: supports symmetric security, asymmetric security, message security, transport security,

  SSL Flow Security, Windows flow security, and so on.

WCF supports multiple session modes: one-way, two-way, request / response.

WCF supports REST .

WCF supports a variety of formatting methods. DataContractSerializer,XmlSerializer,

DataContractJsonSerializer and so on.

WCF supports was hosting,Windows service hosting, Self-hosting,IIS Hosting , and so on.

WCF supports multiple concurrency modes: singleton, monotonic, session. W

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.