Live data from Hacker News

REST is the new SOAP

medium.com

221–230 of 351 posts

Re: REST is the new SOAP

#221

Earlier quoted context omitted.

I happen to have worked with the system author coded/maintained. We're not in touch and I'm not here to defend him, but he's no hipster. Rather, he had to integrate a lot of heterogeneous services, as that system was acting like a hub between many departments in the company, with various tech skills and resources. If anything, I suspect he's more kind of unsatisfied by changes that he deemed unnecessary. As a note as…

Xmlrpc is incredibly underappreciated.

I agree.

If you control client and server and the server's functionality will for the foreseeable future is limited in scope, xmlrpc is the boss.

We had a django/rest based internal microservice. Was a pain to build and maintain. Switched to xmlprc (it's in Python stdlib), removed tons intermediary code, and wrote only a few bits of new code.

This talk by Jonas Neubert opened my eyes to how xmlrpc can be the glue for Python (which is already glue).

https://www.youtube.com/watch?v=cEyVfiix1Lw

Re: REST is the new SOAP

#222
post #172

I tried some experiments earlier this year with radically simpler RPC calling conventions. It's called NSOAP, and is available for express, koa and React. It gets rid of HTTP verbs and treats the url like code. https://github.com/nsoap-official/nsoap-express Some examples. //Adds two numbers http://www.example.com/addTwoNumbers(10,20) //String arguments http://www.example.com/search(thomas) //Parameters http://www.ex…

While on the surface that might seem like a workable idea, getting input validation right is going to require more syntax (making it far less clean). Specifically, URLs are only ever string data, so without type annotation everything is strings, even if it looks like a number, array, or even more complex data type.

Re: REST is the new SOAP

#223
post #13

Why is REST so popular? Because it's easy to implement and works for lots of use cases. I'm sorry that you found places it doesn't, but in the real world, having been through that SOAP pain it's being compared to, I'd say there's not even a comparison. Everyone seems to want to find a reason to dislike product/technology/feature X but in this case, X is just better than anything we've had for a 90% adoption case. Wha…

REST allows you to make decisions about the http interaction out-of-band, where SOAP provides (and often requires) the ability to describe all decisions about types and parameterization and exception cases in-band. The REST way allowed one to get started with something small and simple that people could agree to just by talking it over together. With SOAP you had to make all those decisions up front and put it in the…

CORBA? That's a term that gave me a sudden flashback to debugging nightmares in the 90s.

Re: REST is the new SOAP

#224
post #13

Why is REST so popular? Because it's easy to implement and works for lots of use cases. I'm sorry that you found places it doesn't, but in the real world, having been through that SOAP pain it's being compared to, I'd say there's not even a comparison. Everyone seems to want to find a reason to dislike product/technology/feature X but in this case, X is just better than anything we've had for a 90% adoption case. Wha…

> Why is REST so popular? Because it's easy to implement and works for lots of use cases. Could have given the exact same non-argument for SOAP -- which in its time dominated corporate services. Whether it's "easy to implement and works for lots of use cases", it's a moot point if there would be something even easier to implement and worked even better for real use cases. Why stop at "easy" when you can have easier A…

“Real illuminated REST”? The REST spec?

It’s an architectural style defined by Roy Fielding’s thesis (who also was the editor of HTTP/1.1 RFC). It attempted to describe the Web’s architecture in neutral terms and how it was derived by combining previous styles.

Some people took this and crafted a quasi religion out of it, but that’s partly because vendors in 2002 were all lined up trying to replace the web with a CORBA equivalent and then almost succeeded with SOAP/WS-*. People got strident to fight the dollars that were lined up. It’s easy to forget there was no powerful web/internet community with social media and blogging platforms in those days, it was all mailing lists and a couple of conferences vs. Marketing budgets, sales teams, and agenda-wielding engineers on standards bodies from Microsoft, IBM, BEA, Sun, HP, etc.

All RESTful means is that something is attempting to conform to the style. There never was a spec.

Re: REST is the new SOAP

#225
post #172

I tried some experiments earlier this year with radically simpler RPC calling conventions. It's called NSOAP, and is available for express, koa and React. It gets rid of HTTP verbs and treats the url like code. https://github.com/nsoap-official/nsoap-express Some examples. //Adds two numbers http://www.example.com/addTwoNumbers(10,20) //String arguments http://www.example.com/search(thomas) //Parameters http://www.ex…

While on the surface that might seem like a workable idea, getting input validation right is going to require more syntax (making it far less clean). Specifically, URLs are only ever string data, so without type annotation everything is strings, even if it looks like a number, array, or even more complex data type.

> While on the surface that might seem like a workable idea, getting input validation right is going to require more syntax (making it far less clean)

Input validation will go into the router, which I have created for Express, Koa and React. Application code will not have to deal with validation or parsing.

> Specifically, URLs are only ever string data, so without type annotation everything is strings, even if it looks like a number, array, or even more complex data type.

You'd have to pass more complex data types either in body (as JSON) or as parameters with quoting. Current router does however, infer types to the extent of:

  //Params inferred as string, number, boolean and number.
  curl "http://www.example.com/search(Jeswin,20,true,x)?x=100"

Re: REST is the new SOAP

#226
post #153
post #14

Earlier quoted context omitted.

Well, I'm glad you can put together an RPC api that quick, but the reason REST is so ubiquitous and why arguing against it is going to make you the subject of a witch hunt is because it's so easy to consume. Your API is useless if people don't want to use it.

But like the article mentioned, clients using REST are used to dealing with wrappers written for their language anyway. They'd prefer to not bother with URLs, query strings, and MIME types, and simply consume an API in the language that feels natural for them. You can argue that REST is easier to debug for developers, but nothing makes XML-RPC or binary protocols inherently _less_ easier to debug. It depends on the p…

> are used to dealing with wrappers written for their language anyway

And the wide availability of those is because it's so easy to build one over obvious REST apis.

Re: REST is the new SOAP

#227
I’m fine with REST as a transport mechanism though the resource overload constraint (Swagger) is the sort of thing that might make me dump it.

If I want to overload get with a custom search end point, I should be able to do that without someone’s idea of a perfect resource definition telling me I’m wrong.

This is the sort of thing that made me remove WCF from my resume.

Simple and flexible. This should be any standards mantra.

Re: REST is the new SOAP

#228
Those who refuse to learn history are doomed to repeat it.

REST is not the end of history, there can and should be successor architectures, but RPC is not that successor. It’s been around a very long time and fell out of fashion for good reason. It is a convenient approach that can be used if you have major control over all the interfaces, endpoint implementations and underlying infrastructure, as Google does for its use of gRPC. It really falls over if you want independent implementations and variable infrastructures over a large scale, as is the case for most Internet / Web interactions.

RPC is fundamentally flawed in that it tries to pretend that the network doesn’t exist and that distributed systems don’t have fundamentally different concerns than single computer systems. A good overview of this history from 2009 is here: https://www.scribd.com/mobile/document/24415682/RPC-and-its-...

Keep in mind that REST only became popular around 2007, it was an uphill battle to popularize it from 2001 onwards. The web had grown to a mammoth, and vendors couldn’t make money off it, so wanted to replace it with CORBA or some other RPC (SOAP). It took a concerted effort to fight that in standards bodies, on mailing lists, on blogs. Those days didn’t have Github or social media or a myriad programmer conferences. The posts are still up if you want to see them. This history of having to fight to be perceived as relevant and useful is why REST tends to have a bit of misguided religion behind it. SQL proponents had the same issue longer ago.

The Web and REST led to the largest increase in networked computer interoperability in history, after the TCP/IP suite and Telnet. The architectural style is what catalyze JavaScript into such a ubiquitous language as it made mobile code a first class citizen in the architecture. It’s what catazlyed Google into a powerhouse as it baked self describing, uniform interfaces as the standard, enabling spidering, indexing and analytics on a global scale. Moving on from it will be harder than people realize.

By all means, be an engineer - use RPC if it fits your problem and constraints better. Use event streams if it fits your problem better. Use GraphQL or SPARQL if a data query interface is a better solution for your needs. There is no one architecture. But please, rants about how the world would be better if we all did RPC, it comes across as very divorced from the wide variety of problems and suitable architectures out there.

Re: REST is the new SOAP

#229
REST isn't appropriate as a description of JSON-based apis because JSON isn't a natural hypertext and thus makes HATEOAS difficult to implement. Most JSON APIs described as REST are really RPC APIs with a bit of URL layout taken from the REST world.

Unfortunately XML-RPC was such a nightmare that calling something JSON-RPC was out of the question. Shame.

There are a few blog posts up on the intercooler website that discuss this that I found enlightening:

http://intercoolerjs.org/2016/01/18/rescuing-rest.html

http://intercoolerjs.org/2016/05/08/hatoeas-is-for-humans.ht...

Re: REST is the new SOAP

#230
Although the article somewhat exaggerates the problem and in fact REST is great for many applications, truth is (IMHO) REST is indeed overrated and the RPC style (don't confuse it with SOAP!) is over-vilified in the IT culture. In so many (though far not in all of them) cases a concise JSON-RPC API would be a much more elegant solution than REST. I believe this is a great example of where the "right tool for the job" principle should be applied rather than a buzzword cult.

Many comments here emphasize on the problem of developers expecting RPC functions to be as reliable as local functions are. Well, that's their own problem, IMHO. The only appropriate solution is to remind them they are doing it wrong, e.g. the same way REST gurus use to remind everybody they are doing REST wrong. In fact there is a huge number of "developers" around who just invoke all the file system, database and network (REST, RPC, SOAP or whatever) calls synchronously, don't validate inputs nor outputs and don't even wrap the calls in try/catch (believe me, I used to support a fairly popular API and had to explain this stuff to just soooo many people complaining about their apps hanging or panicking on occasions when our REST API quirks (e.g. a field is missing from the response) or fails).

Post reply on HN