Is it a RESTFUL MVC Web Service?

I know web services and WCF, but I have a common question with services.

I have an ASP.NET MVC application that performs some basic functions. I just have a controller in which I pass records to it and serialize the information in XML using the XML Serializer. Then I return this information to the browser and displays me the XML that I received from the Controller action. Therefore, I get an XML representation of my class (database object) in XML, and I have to provide the URL of this application to the client and access and extract the information.

Is this a service?

I mean, in the end, all clients need to submit Xml through services as well? I am not so experienced and probably very stupid, but please help me ... if I provided xml in this way to the client, is this a Service? Or is there something I need to understand here?

+4
source share
2 answers

Don't let all the buzz about "web services" fool you; the basic idea of ​​a web service is very simple. It is simply a matter of providing data in response to a request using standard web transport protocols (i.e. HTTP / HTTPS). Everything else (XML, SOAP, WSDL, etc.) is just a layered technology that allows you to extend the basic functionality of the service. REST-based services are basically the simplest simple services you can create — they are built on the basic HTTP / S protocol and not much more.

The main difference between a service and a traditional website is that the service is data-oriented, not presentation-oriented; that is, services are usually not related to how the data is formatted and displayed (it depends on the client), but rather what data is returned. So ... are you delivering XML data via HTTP? Check it out. You have a service. Congratulations!

+5
source

Yes, this is a service that returns an XML resource. It also seems to be accessible through standard HTTP verbs such as GET, so it can be assumed that it is RESTful. The difference with the standard SOAP XML service is that you do not have a WSDL that describes it, so you may need to provide good documentation to customers who want to use your service.

+3
source

Source: https://habr.com/ru/post/1306977/


All Articles