WebService and WCF

Source: Internet
Author: User
Tags soap hosting managed hosting msmq

It is easy to understand that WCF is a distributed service framework based on the. NET platform of Microsoft. Both WCF and WebService are implementations of SOA. WCF is unique to Microsoft. WebService is a common service. WCF is a refinement of webservice.

Web Service: Strictly speaking, the industry standard, the Web service specification, also known as the WS-* specification, is neither a framework nor a technology.

It has a complete set of standard system standards, but also in the continuous improvement of the update.

It uses XML extension markup language to represent data (this is the key to language and platform). Microsoft's Web service implementations are called ASP. It uses the 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 use by its customers.
Later, Microsoft made ASP. NET Web service security, performance, data encryption, decryption, managed hosting, and many other extensions, called the WSE series, this is over-product, up to WSE3.0. And then it was the WCF era.

"2" asp: Microsoft provides a development framework for Web services that is part of the ASP. But supports the early-riser WS specification. Like SOAP1.1.
The "3" WCF:WCF is a development framework for distributed applications that belongs to a specific technology, or platform. Neither the standard nor the norm.

WCF is, in part, an ASP. NET Web service, because it supports the industry standard and core protocols of Web service, so what ASP. NET Web service and WSE can do, it is almost capable, Cross-platform and language is not a problem (the data also supports XML formatting and 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 (previously known as "Indigo") is a unified framework for building and running service-oriented services (oriented) applications using managed code. It enables developers to build a secure, trustworthy, transactional solution across platforms that can be compatible with existing systems. WCF is the integrator of Microsoft's distributed application development, which integrates. NET platform, all technologies related to distributed systems, such as Enterprise Sevices (COM +). NET Remoting, Web Service (ASMX), WSE3.0, and MSMQ Message Queuing. In the context of communication (communiation), it can span processes, across machines, across subnets, corporate networks and the Internet, and in the host program, you can host Asp.net,exe,wpf,windows forms,nt service,com+ (Host). WCF can support protocols including tcp,http, cross-process and custom, and security mode includes SAML, kerberos,x509, user/password, custom and many other standards and patterns. That is, under the WCF framework, it is easy to develop a distributed system based on SOA, and Microsoft has included all the technical elements associated with it, mastering WCF as the key to opening the door to SOA. If you want to systematize WCF learning, you must make a pair such as Enterprise Sevices (COM +). Net Remoting, Web Service (ASMX), WSE3.0 and MSMQ Message Queuing also have a detailed understanding of the words, you can look at my blog, before my knowledge of WCF learning has been systematically organized. This is the article directory: Lao Xu's blog: Article directory.
Also, a lot of people are interested in WCF learning, at the outset, I also, directly to WCF, in fact, in the later learning to feel the difficulty, because the WCF claims many features and advantages, we can not understand, more can not realize. The article mentions that many of Microsoft's early technologies, if not touched, will not have a deep understanding of these comparisons.

"4" Conclusion:

Then we look at these analyses and we can see why the above conclusions are wrong.

It is not possible to compare a technical framework with an industry standard, and any comparison between the two is wrong, since the roots are not in the same category. It's like you can't compare a car with a traffic law. This is a mistake.

Web service is too old: The framework versions of the differences, functional features are new and old, but for a particular system, the best for their own. Web service is ASP. NET Web service: Also not a category. The former specification, the latter being framework WCF is better than Web service performance: Not a category, WCF is faster than ASP. NET Web service: Not necessarily, requires specific constraints, WCF uses BasicHttpBinding when using the ASP. NET Web Service agreement. WCF is faster than Web service: The same concept is not strict. WCF is more powerful than Web service: WCF is a distributed technology that integrates a variety of Microsoft, but it should be strictly said: ASP. NET Web service WCF is more secure than Web service: not strict. Second, WCF can also develop completely bare-ben applications. Web service will be replaced by WCF, and Web service will not be replaced by WCF! The former is a set of widely used norms. If WCF can replace ASP. NET Web Service, because both are. The technology on the net platform. WCF is actually the Web SERVICE:WCF in some cases do not adhere to the Web services specifications, that is, can develop non-service nature of the application. and cannot be simply equated. WCF is very simple, but there is nothing: WCF is a service development framework, but if you delve deeper, you will find the power of the WCF architecture. WCF security alone is already quite complex. Moreover, the unified programming model is compatible and supports many early distributed technologies. Many people easily come to the conclusion that they must have read only a few articles or books, not necessarily written code. A master is not so judgmental as to conclude.

In the various protocols that WCF supports: messages in each protocol have different transport formats, different encoding formats, and so on, WCF calls a variety of encoders in a unified manner and transmits them. If a new protocol comes up in the future, WCF will not be able to support the protocol by changing the existing framework, only by extending it for that protocol. This is well adapted to change, and it can be said that WCF is a great practice for package changes.

Let's talk about your problem. What is the relationship between WCF and Web services, WCF is able to create services that are compatible with Web services, which means that you can create services that are interoperable with Web services, and neither of them is represented by simple inclusions or equivalent relationships. WCF is a set of frameworks that are used to create various services . This includes creating a Web service (a service with BasicHttpBinding bindings is a Web service).

WCF can be independent of IIS.
WCF can be configured as BasicHttpBinding to be compatible (or become) WS.
WCF can transmit data based on TCP or Messegequeue.
WCF is more configurable than WS, such as security.
WCF can be stateful and supports transactions.
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 streaming security, Windows streaming 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.

Web Service (can be applied to the Java platform)

1, it is based on the soap and Rest protocol

2, only support HTTP protocol

3. It is not open source, but can be used by any one who knows the XML

4. It can only be deployed on IIS

WCF (. NET platform)

1, this is also soap-based, the data format is XML

2. This is the evolutionary version of Web Service (ASMX) that can support a wide variety of protocols, such as Tcp,http,https,named Pipes, MSMQ.

3. The main problem with WCF is that it is very cumbersome to configure.

4. It is not open source, but can be used by any one who knows the XML

5. It can be deployed in applications or on IIS or in Windows services

WCF Rest

1. To use the WCF Rest service, you must use Webhttpbindings in WCF

2. It uses [WebGet] and [WebInvoke] attributes respectively to implement HTTP GET and post verbs

3, to use other HTTP verbs, you need to do some configuration in IIS, so that the. svc file can accept the request of these verbs

4, the use of WebGet through the parameters of data transmission, also need to configure. And you must specify UriTemplate

5, it supports XML, JSON and atom these data formats

Web API

1. This is a simple new framework for building HTTP services

2. The Web API on the. NET platform is an open-source, ideal technology for building rest-ful services

3, unlike WCF REST Service. It can use all the features of HTTP (such as URIs, Request/response header, cache, versioning, multiple content formats)

4. It also supports MVC features like routing, Controller, action, filter, model binding, inversion of control (IOC), or Dependency injection (DI), unit testing. These can make the program simpler and more robust

5. It can be deployed on applications and IIS

6, this is a lightweight framework, and to limit the bandwidth of devices, such as smartphones and other support is very good

7. Response can be converted into JSON, XML, or any format you want to convert by Mediatypeformatter the Web API.

  

What should I choose for WCF and Web APIs?

1. When you want to create a service that supports message, Message Queuing, duplex communication, you should choose the WCF

2, when you want to create a service, you can use a faster transmission channel, such as TCP, Named pipes or even UDP (in WCF4.5), when the other transport channels are not available can also support HTTP.

3, when you want to create an HTTP-based resource-oriented service and can use all the features of HTTP (such as URIs, Request/response header, cache, versioning, multiple content formats), you should choose the Web API

4. When you want your service to be used in browsers, phones, iphones, and tablets, you should choose the Web API

WebService and WCF

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: info-contact@alibabacloud.com 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.