News for hackers. Stuff that matters.
Re:If you have REST, why use XML-RPC? by billpg on Thursday January 14, 2010 @01:01PM (#1053134)
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.

Re:If you have REST, why use XML-RPC? by generalk on Thursday January 14, 2010 @03:42PM (#1053547)
Go 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.

Re:If you have REST, why use XML-RPC? by generalk on Thursday January 14, 2010 @01:17PM (#1053177)
If 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.
Re:If you have REST, why use XML-RPC? by blasdel on Thursday January 14, 2010 @05:32PM (#1053744)
No! 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.

Re:If you have REST, why use XML-RPC? by generalk on Thursday January 14, 2010 @06:02PM (#1053793)
Both are good! Documentation helps ease users in, while proper hyperlinks make the service discoverable.
Re:If you have REST, why use XML-RPC? by billpg on Thursday January 14, 2010 @01:39PM (#1053242)
In my little thought experiment, I'm implementing the interface to the blatting service.
Re:If you have REST, why use XML-RPC? by jonknee on Thursday January 14, 2010 @01:09PM (#1053154)
I 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.
Re:If you have REST, why use XML-RPC? by conover on Thursday January 14, 2010 @01:13PM (#1053165)
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.
Re:If you have REST, why use XML-RPC? by jonknee on Thursday January 14, 2010 @01:36PM (#1053234)
Agreed, 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.

Re:If you have REST, why use XML-RPC? by Nwallins on Thursday January 14, 2010 @01:10PM (#1053156)
I would put the frobnitz ID into the blat queue:

PUT http://my-fake-server.com/blat_q/2452352

Re:If you have REST, why use XML-RPC? by blasdel on Thursday January 14, 2010 @05:42PM (#1053760)
I 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.