difference between WCF Services and Web Services and REST Service

后端 未结 7 1071
栀梦
栀梦 2020-12-08 14:38

What is the difference between WCF Services and Web Services in .net
When should I use WCF and when to use Web Services.Is REST and WCF service the same? Thanks

相关标签:
7条回答
  • 2020-12-08 15:15

    REST is an architecture

    WCF is a API in .NET Framework to build connected service oriented application.

    In olden days a functionality developed as Web Service was accessible via internet and the same to be available on local network was available via Remoting.

    Using WCF we don't need to develop different code for it to be accessible over internet and on local network. Just configuring it with bindings would be enough.

    0 讨论(0)
  • 2020-12-08 15:16

    I see this is quite an old thread, but I have asked a similar question recently.

    The answers given have all similar relevance, but in my opinion Ray was the closest to what was actually asked. When designing or refactoring a web based solution, you always get the question should we go with SOAP or REST. The answer lies in the complexity of the business logic required behind the service. REST is good for simplistic API calls that usually contains small sets of requested data or over night processing with large sets, but mainly for data requests. SOAP is more of an interactive day to day service with business logic as well. For example many methods with plenty of parameters.

    What we do as part of our web based solution, is to try and make use of both. For internal methods and primary functionalities we use SOAP, but for exposed APIs we prefer REST. Framework related, definitely WCF as preferred choice, irrespective if SOAP or REST.

    0 讨论(0)
  • 2020-12-08 15:18

    Some people mean "ASMX" when they say "Web Services".

    Others just use "Web Services" to mean the generic technology, and consider WCF to be the current way to create Web Services on the .NET platform. The other kind are "ASMX Web Services", as distinguished from "WCF Web Services".

    The "other kind" are a legacy technology, supported only for backwards compatibility. They should not be used for new development, so there's no point in you learning about them.

    As others have stated, "REST" is an architecture style, not a technology.

    0 讨论(0)
  • 2020-12-08 15:21

    Wcf:wcf is a technology as part of .net framework which provides environment to work with different distributed technologies an by following unified programming model. wcf create a proxy. wcf support data contract serializer. records shown xml format.

    **Rest:**Rest is an architectural style.which says use the existing features of the web in more effective,efficiency and simple manner.verbs like insert,update and delete. Rest cannot create a proxy. rest records shown jason format.

    Web Service:a service which is hosted on website is called as webservice. web service support xmlserializer

    0 讨论(0)
  • 2020-12-08 15:26

    That is a very wide question...I am going to just give a brief high-level answer and suggest that you do some more searching as there are is already a lot written on each subject. But, hopefully this should give you a push in the right direction.

    First, typically when people refer to WCF Services and Web Services, they are referring to the newer WCF conventions that make service calls fairly generic (they can be SOAP, REST, etc) and the old .asmx SOAP method of Web Services. So, along these lines, I would suggest looking more into WCF and SOAP/.ASMX for the difference of WCF and older Web Services.

    As to WCF and REST, they are not the same. REST is more of an architecture, whereas WCF is a framework. As I already mentioned, WCF can be used to make SOAP calls or REST calls. I am not sure I can add much more without going into greater detail.

    I will see if I can find some good articles on REST and WCF a little later, though. Personally, I do not see a reason to even pursue very far into the older way of calling web services (.ASMX pages) as WCF has pretty much made that obsolete. However, learning many different ways to skin a cat can be useful in an endeavor to find what fits you best.

    Again, this is VERY high level, but these are very general topics with a lot surrounding each, so hopefully a high level overview will help direct you in studying deeper on each subject.

    0 讨论(0)
  • 2020-12-08 15:32

    Web Service is an abstract term encompassing a large variety of data providers for distributed systems. Perhaps you are referring to ASMX web services, which can still be found in the wild but aren't really widely used in new development these days.

    WCF Service is Microsoft's implementation of SOAP. There are others implementations or you could roll your own (not recommended).

    SOAP is a kind of stateful, session-based, message-based web service. It's good if your service is designed as a set of complex actions.

    REST is a stateless, sessionless, resource-based web service. It's good if your service is designed to access data and perform simple CRUD operations on it. SOAP and REST are mutually exclusive. A service cannot be both. There are ways to manipulate vanilla WCF to make is RESTful but these techniques are becoming deprecated. If you want to implement a RESTful web service there are two main choices in the Microsoft world: WCF Data Services and ASP.NET Web API.

    0 讨论(0)
提交回复
热议问题