Questions tagged [web-services]
Web services are software systems designed to support interoperable machine-to-machine interaction over a network.
47
questions
72
votes
7
answers
75k
views
How essential is it to make a service layer?
I started building an app in 3 layers (DAL, BL, UI) [it mainly handles CRM, some sales reports and inventory].
A colleague told me that I must move to service layer pattern, that developers came to ...
78
votes
6
answers
29k
views
Why is it so bad to read data from a database "owned" by a different microservice
I have recently read this excellent article on the microservice architecture: http://www.infoq.com/articles/microservices-intro
It states that when you load a web page on Amazon, then 100+ ...
32
votes
7
answers
6k
views
What are the deciding factors in choosing to expose a web service as a SOAP or REST service?
As far as I can see consuming SOAP requires a SOAP stack, so it is harder for your clients to consume i.e. they need to ensure that they have a SOAP stack in place that formats the POST data and the ...
32
votes
3
answers
82k
views
Should I return a 204 or a 404 response when a resource is not found?
I am developing a simple RESTful service for tournaments and schedules. When a tournament is created through a POST request containing a JSON body, the tournament is inserted in a BiMap, declared as ...
21
votes
4
answers
18k
views
Maintaining referential integrity between a mobile client and a server
So I have a relatively simple system. A mobile client creates records in a sqlite database that I would like to have synced to a remote SQL server (that is shared with other mobile clients). So when I ...
15
votes
1
answer
8k
views
Software architecture for authentication/access-control of REST web service
I am setting up a new RESTful web service and I need to provide a role-based access control model. I need to create an architecture that will allow users to provide their username and password to get ...
5
votes
2
answers
2k
views
Exception versus return code in DAO pattern
After reading a lot about the abusive use of exceptions in Java and how you should let an exception bubble up through the different layers of an application, I've come to a point where I don't know ...
26
votes
4
answers
86k
views
REST: Can I use POST request to read data?
Is it against best-practices to use a POST request to read data? Are there any exceptions to this? e.g. Authentication requests where you have to POST data to perform a read action.
I have an API ...
20
votes
4
answers
20k
views
Microservices REST or AMQP, which case
I've read many articles concerning microservices architecture and I was wondering when to use AMQP or REST.
I've read that loose coupling between services is a good thing and AMQP seems to be a good ...
9
votes
2
answers
3k
views
Microservices & Canonical model
When I was reading about microservices on this site, I came across the below statement. What is meant by a canonical schema? Isn't it same as domain model?
The Microservices Architecture pattern ...
8
votes
4
answers
5k
views
What HTTP status using for REST search query which returns nos results
I'm wondering how to manage empty results returned by search queries in a REST web-service :
I there was a query like my_ressource_collection/{id} and the resource didn't exists i would return 404 - ...
7
votes
3
answers
5k
views
How to handle business rules with a REST API?
I have a REST API to manage a booking system
I'm searching how to manage this situation :
A customer can book a time slot :
A TimeSlot resource is created and linked to a Person resource. In order to ...
2
votes
1
answer
413
views
Should we create classes just to group properties
I am designing a bit of software that will integrate with our enterprise system using web services. We are dealing with work orders that are needed to maintain equipment.
We have a bit of a ...
113
votes
3
answers
137k
views
Should cookies be used in a RESTful API?
I'm specifically interested in how users perform authorized / authenticated operations on a web API.
Are authentication cookies compatible with the REST philosophy, and why?
88
votes
3
answers
194k
views
Difference between Web API and Web Service?
I have heard a lot about Web Services and Web APIs, is there any difference between them or are they the same?
64
votes
10
answers
36k
views
When would you use a long, string ID instead of a simple integer? [closed]
I'd like to use Youtube as an example: they use IDs in the form of PEckzwggd78.
Why don't they use simple integers?
Or imgur.com - they also use IDs such as 9b6tMZS for images and galleries. Not ...
44
votes
4
answers
18k
views
REST - Tradeoffs between content negotiation via Accept header versus extensions
I'm working through designing a RESTful API. We know we want to return JSON and XML for any given resource. I had been thinking we would do something like this:
GET /api/something?param1=value1
...
42
votes
5
answers
15k
views
Why not use SQL instead of GraphQL?
Recently I learned about GraphQL which claims to be superior to RESTful. However, I started wondering why don't we simply put SQL statements into an HTTP GET request.
For example, in GraphQL I would ...
37
votes
4
answers
9k
views
Should MVC/REST return a 403 or 404 for resources belonging to other users?
When working with a resource-based site (such as an MVC application or REST service), we have two main options when a client tries to GET a resource that they don't have access to:
403, which says ...
24
votes
4
answers
12k
views
Why do people think SOAP is deprecated? [closed]
While browsing SO today I found this question here and it starts with this:
Sure, you're gonna tell me that SOAP is depracated and all, well i'm forced to use it
Found lots of statement like this ...
22
votes
4
answers
36k
views
REST vs RESTful vs "normal" web service - the same or not?
I've read a couple of definitions and discussion on REST and/or RESTful applications, but I still do not understand the real meaning of it.
I usually work with the apps which either fetch data via ...
21
votes
7
answers
42k
views
Are mutliple database calls really significant with a network call for a web API?
At one of my employers, we worked on a REST (but it also applies to SOAP) API. The client, which is the application UI, would make calls over the web (LAN in typical production deployments) to the API....
20
votes
3
answers
32k
views
Why to use web services instead of direct access to a relational database for an android app?
I searched on the web how to access in an efficient manner to a central database at a remote location and I met suggestions to use web services instead direct access (i.e. JDBC etc ) to a database.I ...
18
votes
3
answers
10k
views
Where to put business logic if using Firebase?
I'm about to start developing a single page web application that is very simplified a multi user documentation system. The front end will probably use Angular2.
The project has a short deadline, so I'...
13
votes
3
answers
3k
views
What is the best way to do offline failover of a desktop based client that uses a web service?
I have three incoming projects that share a common problem:
they need to have the logic on a web system and they need a local application (e.g. point of sale) that communicates with such system ...
11
votes
1
answer
6k
views
Is it bad to use POST only on an API?
I'm about to develop a new API for our website. Part of the design I've considered to use the POST and GET methods but after reading some security stuff I realise that GET is a bit less secure(i.e. ...
9
votes
2
answers
21k
views
What does RESTful web applications mean? [duplicate]
Possible Duplicate:
What is REST (in simple English)
What does RESTful web applications mean?
A web service is a function that can be accessed by other programs over the web (Http). To clarify a ...
8
votes
3
answers
2k
views
OAuth alternative for a 2 party system
I'm writing a RESTful service (Java EE, Jersey) and a client application that communicates with it, and I wish to secure it and store any usernames & passwords dedicated in my own database.
I do ...
8
votes
3
answers
12k
views
Understanding the difference between Webservices and Service Layer
My understanding of a webservice and service layer is as follows -
Service Layer: An abstraction layer which exposes a set of common operations which can be used by multiple consumers. For instance , ...
8
votes
4
answers
2k
views
Advantages of HATEOAS based RESTful service
There is a scenario, where we have two commercial applications that are so called REST based(java) but not HATEOAS compliant. Development activity is out-sourced to vendor
Development phase of ...
7
votes
3
answers
1k
views
Motivation for a service layer (instead of just copying dlls)?
I'm creating an application which has 2 different UIs so I'm making it with a service layer which I understood is appropriate for such scenario.
However I found myself just creating web methods for ...
7
votes
2
answers
2k
views
How does user authorization work in a Microservice architecture
I'm learning how to design a Microservice architecture. For example, here is a simple Microservice architecture:
I'm kind of confused by the Account Service.
As we know, for a web service, normally ...
7
votes
3
answers
15k
views
Should I use both WCF and ASP.NET Web API
We already have a WCF API with basichttpbinding.
Some of the calls have complex objects in both the response and request.
We need to add RESTful abilities to the API.
at first I tried adding a ...
5
votes
2
answers
5k
views
REST Service and CQRS
I am struggling with architecture on a new project. I am using the following patterns/technology.
CQRS - anything going in goes through a command
REST - using WebAPI
MVC - asp.net mvc
Angular - ...
5
votes
3
answers
6k
views
Integration Testing: Testing Service to Service
I'm looking for some advice on testing strategies for service to service communication.
I have one service (service A) that makes a call to another service (B) - which is a rest API. Both services ...
4
votes
2
answers
6k
views
Why put a simple query into a stored procedure in a web service?
I'm working as a junior programmer, and the senior programmer above me has instructed me to follow a certain unofficial policy for constructing new queries on our web development projects. Generally, ...
4
votes
1
answer
2k
views
Which approach should I use to split a monolithic application into several microservices?
We have a huge project that desperately needs to be broken apart into multiple databases and applications. I can think of 2 possible approaches to this problem:
Use a REST endpoint on each service to ...
4
votes
5
answers
583
views
Is SOA suitable for developers or only for business/IT management people?
Let's suppose you're the lead of a team of developers that needs to build a big information system such as an ERP or Human Resources software, or whatever system that is composed by multiple business ...
3
votes
2
answers
1k
views
Which Java framework meets these requirements? [closed]
Which Java framework meets these requirements?
What set of frameworks would be best suited to meet these requirements?
The requirements are:
oriented for web
support for transactions
support for ...
3
votes
8
answers
952
views
What is "The Cloud"? What do I say when people ask if my web service is "on the cloud"? [duplicate]
Possible Duplicate:
What is “the Cloud” and how does it relate to development?
First some context: I don't understand what people are asking when they ask "It it on the cloud?" Here ...
3
votes
3
answers
4k
views
Do application-level caches belong inside web servers?
A coworker and I have a disagreement about where the cache for a webserver should go. We currently have it implemented as a global (static) in-process cache, which I don't agree with. I think the ...
2
votes
1
answer
658
views
Java code design for a Geocoder Webservice client
Please bear with me, if this type of question has been asked before. I am having a dilemma with object design and seeking experts' help here to come up with the correct/better design for a webservice ...
2
votes
1
answer
162
views
Where does the burden of responsibility and support from shared components/services lie?
This is an issue that has somewhat been raised by the left-pad incident with NPM but I'm also interested in it from an internal business perspective.
For example imagine an organisation with 3 teams, ...
1
vote
2
answers
375
views
Does Service-Oriented Architecture require the robustness principle?
I try to migrate more and more of our IT infrastructure to a Service-Oriented Architecture (SOA), that means separation of independent tasks and implementation of this tasks as decoupled services, ...
1
vote
1
answer
6k
views
Architecture for OAuth2 - BackendServer - FrontendServer
I'm developing an whole ecosystem with an OAuth2 Provider, a Backend Server and a Frontend Server.
OAuth2 Provider: provide only the authentication/authorization for the user, and a few other general ...
1
vote
1
answer
3k
views
Business logic - Server side vs client side [duplicate]
In my current project, I have a screen which pulls data from several webservices, pulls data from database via backend API and checks that all resources have the same data or not.
The other ...
0
votes
2
answers
547
views
Creating REST-ful web-services without adhering to the REST principles
I have built an application which acts as an interface between an EAI layer and third party vendor applications. I am using REST-ful web services for this, making use of JAX-RS API and Jersey ...