Skip to main content

Questions tagged [web-services]

Web services are software systems designed to support interoperable machine-to-machine interaction over a network.

Filter by
Sorted by
Tagged with
115 votes
17 answers
24k views

Why should 'boneheaded' exceptions not be caught, especially in server code?

I am confused because in quite a few places I've already read that the so-called 'boneheaded' exceptions (ones that result from bugs in code) are not supposed to be caught. Instead, they must be ...
gaazkam's user avatar
  • 4,459
113 votes
3 answers
138k 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?
Brandon Linton's user avatar
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?
Harish Kurup's user avatar
  • 1,269
78 votes
6 answers
30k 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+ ...
David's user avatar
  • 4,439
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 ...
BornToCode's user avatar
  • 1,273
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 ...
Rakori's user avatar
  • 787
64 votes
3 answers
22k views

What is the present-day significance of SOAP

Last I encountered a SOAP based service was during my internship in a financial firm in 2013. That was the time when I started my career in IT. I remember having some study material about SOAP in one ...
Abhas Tandon's user avatar
53 votes
9 answers
12k views

Should you guard against unexpected values from external APIs?

Lets say you are coding a function that takes input from an external API MyAPI. That external API MyAPI has a contract that states it will return a string or a number. Is it recommended to guard ...
Adam Thompson's user avatar
47 votes
2 answers
33k views

Suggested HTTP REST status code for 'request limit reached'

I'm putting together a spec for a REST service, part of which will incorporate the ability to throttle users service-wide and on groups of, or on individual, resources. Equally, time-outs for these ...
Andras Zoltan's user avatar
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 ...
Brandon Linton's user avatar
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 ...
nalzok's user avatar
  • 569
37 votes
4 answers
24k views

Best practices for execution of untrusted code

I have a project where I need to allow users to run arbitrary, untrusted python code (a bit like this) against my server. I'm fairly new to python and I'd like to avoid making any mistakes that ...
p.s.w.g's user avatar
  • 4,175
37 votes
3 answers
35k views

When are RPC-ish approaches more appropriate than REST?

After watching this talk on REST, Reuse and Serendipity by Steve Vinoski, I wonder if there are business cases in greenfield projects for (XML-)RPC-ish setups, that REST could not solve in a better ...
miku's user avatar
  • 1,508
36 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 ...
Aaronaught's user avatar
  • 44.4k
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 ...
user avatar
32 votes
3 answers
83k 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 ...
dabadaba's user avatar
  • 2,256
28 votes
5 answers
6k views

I'm not seeing 'tightly coupled code' as one of the drawbacks of a monolithic application architecture

One of the most common things I see when discussing pros/cons of microservice vs monolithic architecture is that monolithic applications have, or always trend toward, 'tight coupling.' To be honest, I'...
Bob Dole's user avatar
  • 421
26 votes
2 answers
20k views

Move from JSON to Protobuf. Is it worth it?

We have REST webservices that can serve XML or JSON (WCF). I'm toying with idea of implementing Protobufs. Why? PROS Less load on servers. Smaller message size - less traffic. It is easier to switch ...
katit's user avatar
  • 681
26 votes
10 answers
7k views

API design: concrete vs. abstract approach - best practices?

When discussing APIs between systems (on the business level) there are often two different point of views in our team: some people prefer a more - lets say - generic abstract approach, other a ...
erik's user avatar
  • 377
26 votes
4 answers
87k 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 ...
Mahdi's user avatar
  • 1,993
25 votes
3 answers
47k views

What is a recommended pattern for REST endpoints planning for foresighted changes

Trying to design an API for external applications with foresight for change isn't easy, but a little thought up front can make life easier later on. I'm trying to establish a scheme that will support ...
Brett Ryan's user avatar
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 ...
user98q37479's user avatar
24 votes
4 answers
7k views

How should I architect a RESTful webservice to use 3rd party (i.e. Google, Facebook, Twitter) for authentication?

For my job we have a nice RESTful webservice we've built out that we use to drive a couple websites we have. Basically the webservice lets you create and work with support tickets, and the website is ...
Ralph Callaway's user avatar
23 votes
5 answers
23k views

If a microservice architecture needs a separate database per microservice then it's too costly & unmanageable. Why do we even need it?

I read about microservices and it seems illogical to me to create a separate DB per service just to achieve isolation. I can achieve the same using only web services and a single database. Why do we ...
Posting Questions's user avatar
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 ...
deviDave's user avatar
  • 2,953
22 votes
2 answers
37k views

Best way to maintain data between local and remote sql databases [duplicate]

So I have, what would seem like a common question that I can't seem to find an answer to. I'm trying to find what is the "best practice" for how to architect a database that maintains data locally, ...
JoeCortopassi's user avatar
21 votes
5 answers
66k views

How can I unit test a class which requires a web service call?

I'm trying to test a class which calls some Hadoop web services. The code is pretty much of the form: method() { ...use Jersey client to create WebResource... ...make request... ...do ...
Chris Cooper's user avatar
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....
ashes999's user avatar
  • 1,129
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 ...
JoeCortopassi's user avatar
21 votes
5 answers
16k views

Internal and external API architecture

The company I work for maintains a successful SaaS product that grew "organically" over the years. We are planning to expand the line with a suite of new products that will share data with the ...
Drew Goodwin's user avatar
21 votes
2 answers
8k views

Has anyone ever claimed a warranty on an SSL certificate? [closed]

SSL certificates often advertise varying amounts of warranties or guarantees, for example $500,000 or $1m. My question is, in the history of SSL, has anyone ever actually successfully claimed one of ...
Tom's user avatar
  • 681
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 ...
ysldl's user avatar
  • 401
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 ...
Thomas thomas's user avatar
18 votes
3 answers
31k views

Handling token renewal / session expiration in a RESTful API

I'm building a RESTful API that uses JWT tokens for user authentication (issued by a login endpoint and sent in all headers afterwards), and the tokens need to be refreshed after a fixed amount of ...
Óscar López's user avatar
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'...
Magnus's user avatar
  • 415
17 votes
3 answers
12k views

What should be the scope of a health check for a system which deploys a webapp?

Today I had a task to "write a health check" for a long running service that is an orchestration system to deploy a web-app. I am trying to determine what the scope for such a health check would be, ...
Phil Winder's user avatar
17 votes
3 answers
24k views

How to design a REST API to handle non-CRUD operations?

I'm trying to convert a set of SOAP-based services to a RESTful API. I started by identifying resources by analyzing operation names and I got the resource Subscription. When I need to update the ...
Vektor88's user avatar
  • 345
15 votes
1 answer
18k views

What are the best practices to secure a web API?

I need to build a web service API for our mobile app to interact with our server & database (in ASP.Net MVC 4, but that's hardly relevant). Wile most actions do not need users to be registered ...
Antoine's user avatar
  • 527
15 votes
3 answers
25k views

How to represent object references in JSON?

I am trying to figure out what's the best approach when dealing with object references in a JSON to be sent to my server for deserialization. To clarify, what I mean is how to refer to data contained ...
dabadaba's user avatar
  • 2,256
15 votes
3 answers
20k views

How to design highly scalable web services in Java?

I am creating some Web Services that would have 2000 concurrent users. The services are offered for free and are hence expected to get a large user base. In the future it may be required to scale up ...
Kshitiz Sharma's user avatar
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 ...
Allen's user avatar
  • 281
15 votes
3 answers
1k views

Does SOA service composition actually work in practice?

One of the main SOA service design principles is Service Composability principle (https://en.wikipedia.org/wiki/Service_composability_principle). The idea is that by composing new services using ...
Janne Mattila's user avatar
14 votes
3 answers
11k views

ASP.NET MVC vs WCF for REST API + Webpage usage

I think the discussion for programmatic service oriented usage vs human interaction is clear. But if I were to create an application that makes use of both a programmatic API and a website that makes ...
Xster's user avatar
  • 249
13 votes
7 answers
1k views

Why is a small fixed vocabulary seen as an advantage to RESTful services?

So, a RESTful service has a fixed set of verbs in its vocabulary. A RESTful web service takes these from the HTTP methods. There are some supposed advantages to defining a fixed vocabulary, but I don'...
Matt Esch's user avatar
  • 1,193
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 ...
dukeofgaming's user avatar
13 votes
5 answers
759 views

How can you effectively use web services in an enterprise environment if you can't use transactions?

The place I'm working at is trying to establish some ground rules, and the debate we're having now is local libraries vs web services for code reuse. Web services seem to be the popular pick in most ...
ryeguy's user avatar
  • 267
13 votes
1 answer
7k views

When should I use AtomPub?

I have been conducting some research into RESTful web service design and I've reached what I think is a key decision point so I thought I'd offer it up to the community to get some advice. In keeping ...
Gary's user avatar
  • 24.4k
12 votes
2 answers
7k views

What's the best RESTful URL structure for a recursive resource?

I'm creating a RESTfull service for a tree-like resource structure and was wondering what the best URL structure would be? I have three requirements: be able to get a collection of root resources ...
Matt Brailsford's user avatar
12 votes
3 answers
8k views

CRUD API: How do you specify which fields to update?

Let's say you have some kind of data structure, which is persisted in some kind of database. For simplicity, let's call this data structure Person. You are now tasked to design a CRUD API, which ...
Heinzi's user avatar
  • 9,798
11 votes
7 answers
6k views

Will Authentication over HTTPS Slow My Application?

I am building a web application and RESTful web service. I have been reading various articles about the best way to authenticate the requests to the web service. The best option for me seems to be ...
GWed's user avatar
  • 3,135

1
2 3 4 5
13