[Catalyst] Re: Catalyst and Web Services?

Aristotle Pagaltzis pagaltzis at gmx.de
Mon Feb 4 13:14:46 GMT 2008


* Gavin Henry <ghenry at perl.me.uk> [2008-02-04 12:05]:
> If you want to provide access over SSL with auth, i.e. for
> example a desktop app posting and retrieving info from/to a
> Catalyst app what's the best way?
> 
> REST or SOAP?

Well, the question you’re asking is actually REST or WS-*; SOAP
is actually just an envelope format that can be used in both
scenarios. Of course in practice no one uses SOAP for REST
because it adds no value that you can’t get another way anyway.

Anyway, between WS-* and REST, the answer is clearly REST, with
the only exception being if you need to integrate with existing
infrastructure that is already heavily geared toward WS-* – in
short, you’re in a Microsoft shop.

> I want the same users that normalling login via a web browser
> and get a cookie to be able to login via a "light" wee desktop
> app or some such?
> 
> Would you create a new interface/access point on the Cat site
> and use REST or SOAP?
> 
> All new to me, so excuse the dumb questions.

I don’t know what you’re doing, so I can’t say if it’ll work for
your case, but in the very least as a source of inspiration, take
a look at Atompub. It’s a great example of how to structure a
REST system, and in fact, with a little creativity, it is a close
match for the great majority of scenarios in which people want to
provide an API. The advantage is that there is already a bunch of
code that implements Atompub, both on the client but also on the
server – see Catalyst::Controller::Atompub.

But, as I said, even if it *really* doesn’t fit your needs, it
gives you an idea for how a REST service should look like.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>



More information about the Catalyst mailing list