简体   繁体   中英

Difference between WCF rest and Wcf soap Services

Am new to wcf concept.

As Per my understanding, if the service endpoint binding is basicHttpBinding then it is soap service.

And if the endpoint binding is webHttpBinding then it is Rest service.

In short if we can able to retrive result from browser by calling public methods, then it's a rest service..

Please suggest is that correct.

Note: in case services are public accessible

In WCF you can use either the BasicHttpBinding (SOAP 1.1 specification) or the WSHttpBinding (SOAP 1.2 specification) for SOAP web services. Both of these bindings support SOAP messages.

The WebHttpBinding supports HTTP requests, and not SOAP messages. However, a REST service is a lot more than just responding to HTTP requests, it is more about how you respond to the HTTP request, eg, using the HTTP verb (GET, POST, PATCH, DELETE) to map onto operations on a resource, so that GET = read, POST = create, PATCH = update, and DELETE = delete. See this Wikipedia for the basics.

So a WCF service may use the WebHttpBinding but not be a RESTful service. There is a lot more work involved to create a proper RESTful service. In converse, a RESTful service does not need to use WCF and the WebHttpBinding. I recommend instead using ASP .Net Core and MVC to develop REST APIs. There is a good tutorial here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM