xISBN and REST
Looking at the xISBN service docs tonight while running Pleiades data import tests, I see that there is support for "REST-ful" short URLs in version 1 and cool URIs in version 2. That seems pretty cool to me, so let's try one out:
sean@lenny:~$ curl -v http://xisbn.worldcat.org/webservices/xid/isbn/0596002815 > GET /webservices/xid/isbn/0596002815 HTTP/1.1 > Host: xisbn.worldcat.org > Accept: */* > < HTTP/1.1 200 OK < Server: Apache-Coyote/1.1 < Content-Type: text/xml;charset=UTF-8 < Content-Length: 305 < Date: Wed, 28 May 2008 06:04:12 GMT < <?xml version="1.0" encoding="UTF-8"?> <rsp xmlns="http://worldcat.org/xid/isbn/" stat="ok"> <isbn >0596002815</isbn> <isbn >1565928938</isbn> <isbn >1565924649</isbn> <isbn >0596513984</isbn> <isbn >2841770893</isbn> <isbn >1600330215</isbn> <isbn >8371975961</isbn> </rsp>
Looks good (links would be even better), but that "stat" attribute on the rsp element smells a little fishy ... let's try a bogus ISBN:
sean@lenny:~$ curl -v http://xisbn.worldcat.org/webservices/xid/isbn/05960bogus > GET /webservices/xid/isbn/05960bogus HTTP/1.1 > Host: xisbn.worldcat.org > Accept: */* > < HTTP/1.1 200 OK < Server: Apache-Coyote/1.1 < Content-Type: text/xml;charset=UTF-8 < Content-Length: 103 < Date: Wed, 28 May 2008 06:13:38 GMT < <?xml version="1.0" encoding="UTF-8" ?> <rsp xmlns="http://worldcat.org/xid/isbn/" stat="invalidId"/>
The response has a status code 200, which should mean success, but there's an error code specific to xISBN in the representation: "invalidID". The underlying RPC nature of xISBN leaks through the cool URI abstraction in this situation. That request has to result in a 404 ("Not Found") if xISBN is going to be RESTful, right?
Speaking of curl, Mark Nottingham points out a potential pitfall and collects a bunch of useful comments here.
Comments
Re: xISBN and REST
Author: erich
xISBN successfully found a result for the bogus isbn, and the result was that it was bogus. You have a problem with that???