5 ms·
SOAP an its ilk seem the easiest solution at first glance. Say I've got a server that can blat a frobnitz, what could be simpler than supplying a pair of functi
by billpg 17y ago
SOAP an its ilk seem the easiest solution at first glance. Say I've got a server that can blat a frobnitz, what could be simpler than supplying a pair of functions?
int[] GetBlattableFrobnitzIDs();
void BlatFrobnitz(int frobnitzId);
Two functions that just magically appear when you point your IDE at a server and tell it to automatically generate a proxy class. Simple!
What's the REST alternative? Getting the list of IDs is okay, but how do you give a "blat" instruction? Until you've experienced REST in anger, its not obvious what you need to do.
Go beyond superficial uses and REST shines, but a beginner used to calling library functions might not see it.
- jonknee 17y agoI loathe SOAP, but it may just be because Python doesn't support it well. In your example it seems like the obvious thing would be to make a POST request to /blat-frobnitz.
- conover 17y agohttps://fedorahosted.org/suds/ https://fedorahosted.org/suds/ Suds is the only decent Python module for SOAP that I've seen. I've never been able to get ZSI or others to work very well.
- jonknee 17y agoAgreed, but I ran into some issues with Suds the last time I used it and ended up having to make a patch. I'm not familiar enough with either Suds or SOAP to know who's fault it was, but the whole experience still took way too long. I'm sure it's great stuff if you're on Java or .NET and have an IDE do all the magic for you, but SOAP is really ugly from the outside.
- Nwallins 17y agoI would put the frobnitz ID into the blat queue: PUT http://my-fake-server.com/blat_q/2452352 http://my-fake-server.com/blat_q/2452352
- blasdel 17y agoI don't think you're doing that right. PUT is idempotent, so it should only be used to update an entire resource -- no creating (POST), no partial updates (PATCH). It would be best to have a URL linked to in a response somewhere that you can POST to to add to the queue, which responds with a 201 or 303.
- generalk 17y agoIf I'm operating a Frobnitz service and my documentation doesn't indicate how to Blat a given Frobnitz, then the failing isn't my communication layer, it's my documentation.
- billpg 17y agoIn my little thought experiment, I'm implementing the interface to the blatting service.
- blasdel 17y agoNo! REST begs you not to have any separate documentation that is mandatory to understand your API. The response from the Frobnitz resource should contain hypertext that indicates how to Blat it: at least the method and url.
- generalk 17y agoBoth are good! Documentation helps ease users in, while proper hyperlinks make the service discoverable.
- generalk 17y agoGo beyond superficial uses and REST shines, but a beginner used to calling library functions might not see it. I'm fairly certain this is the reason that XML-RPC/SOAP has succeeded in the enterprise space and REST hasn't.