Reputation: 2997
I am looking for clarification on the definitions of Web service(s) and endpoints.
I have always thought of web service and services as the same thing but I am not sure if this is correct. I have always thought of Endpoints are related to the resource they are retrieving and not whether it is a PUT/POST or whatever.
So with my understanding the following are two separate endpoints regardless if they are PUT
, DELETE
and so on:
/user/
/organization/
And as a collective the application is a Web Service.
I have seen others document each resource including the HTTP verb as a separate endpoint and that each resource is a web service and so a collection of the resources are web services like so.
Web Services (Web Service x2):
/user/
/organization/
Endpoints (two):
GET /user/
POST /user/
Is there a general clarification or standard that I am missing? If not what is the common definitions of Endpoint, Web Service and Web Services
Cheers
Upvotes: 0
Views: 231
Reputation: 130837
You can understand endpoint as the URL where your service can be accessed by a client application. And a webservice can have multiple endpoints.
Webservices can use the REST architectural style, which is protocol independent, but it's frequently designed over HTTP.
The REST architectural style was defined in the chapter 5 of Roy Thomas Fielding's dissertation. And the following set of constraints was added to this architecture:
The fundamental concept in a RESTful API is the resource. Resources can have different representations. For more details, this answer can be helpful.
Consider, for example, a webservice that exposes the following endpoints:
/messages
: This endpoint identifies a collection of message
resources./messages/{id}
: This endpoint identifies a particular message
resource.Operations can be performed on the resources by performing HTTP requests to the endpoints using HTTP methods, as following:
GET /messages
: Get all messages.DELETE /messages
: Delete all messages.POST /messages
: Create a new message.GET /messages/{id}
: Get a message using the identifier.DELETE /messages/{id}
: Delete a message using the identifier.PUT /messages/{id}
: Replace a message using the identifier.Upvotes: 2