in reply to Re^2: start over with SOAP in Perl?
in thread start over with SOAP in Perl?
Look at it like this. REST is simple. You need to usually develop your own library to access a REST service, but the REST service is fairly well documented if it is in any way popular. I'd argue PM's XML format to be like that, once you find the docs. :) Anyway, you have to relearn how someone implements rest. Speaking of which, you argue that SOAP is done over HTTP by default. What do you think REST services tend to be written over? :)
I don't view REST as being written "over" anything; rather, it's using HTTP to a fuller extent. For instance, a web service may require user/pass authentication. Many of them do it something like this:
GET /path/to/service?user=foo&pass=bar HTTP/1.1 Host: foobar.com HTTP/1.1 200 OK [other headers] Content-Type: text/plain Error: Username/password invalid
This was acceptable practice back when CGIs were the standard. These days, mod_perl (and equivilents for other languages and servers) let us hook into the server more deeply, including taking over the authentication layer, so we can handle authentication using the headers HTTP already has:
GET /path/to/api?name1=value1&name2=value2 HTTP/1.1 Host: foobar.com Authorization: Basic Zm9v0mJhcg== HTTP 401 Unauthorized [Other headers] [Optional return data]
The advantage here is that you often don't have to write a new library, at least for these common things. LWP::UserAgent (and other WWW libaries) already knows how to do HTTP basic and digest authentication, and its is_success() method should return false for a 401 HTTP response.
The more complex parts of your application will always require code, of course, but letting HTTP handle the things HTTP knows how to handle means that you can focus on the harder bits.
"There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: start over with SOAP in Perl?
by exussum0 (Vicar) on Aug 30, 2006 at 22:03 UTC | |
by hardburn (Abbot) on Aug 31, 2006 at 19:33 UTC | |
by exussum0 (Vicar) on Aug 31, 2006 at 19:40 UTC | |
by hardburn (Abbot) on Aug 31, 2006 at 19:43 UTC | |
by exussum0 (Vicar) on Aug 31, 2006 at 19:49 UTC |