in reply to Re^4: start over with SOAP in Perl?
in thread start over with SOAP in Perl?

My point was that LWP::UserAgent has already written that code for you, if you design the server end to properly take advantage of what HTTP already has to offer. LWP::UserAgent already knows how to parse '401 Unauthorized'.

You can still choose to write some additional error handling code, but your overall code will be simpler. More complicated things will need more complicated code, no matter if you use SOAP or REST, so no loss there.

"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^6: start over with SOAP in Perl?
by exussum0 (Vicar) on Aug 31, 2006 at 19:40 UTC
    Not true. You cannot use HTTP error codes for everything. What if you were to use a service where you needed to retieve a record. In SOAP, you don't have to parse the response content manually. It'd be returned back to you as your toolkit provides for you, either as a hash, an object or /something/.

    In REST, i have to put the effort in to take the format and use something on it, whether it's a comma delimited parsing module, an xml parsing module or something custom.

    Look at the perlmonks XML services. If it were in SOAP, I wouldn't need to run an XML parser on them. All of my data would automagically, by the toolkit, be passed back as a hash or set of objects.. or set of arrays. Less to think about.

      I can use HTTP error codes for user/pass authentication, but plenty of web apps out there don't. That's what REST is--make full use of HTTP where it already has that functionality. Use custom code for everything else.

      "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.

        Skip user auth. You're missing the broader problem. User auth is a narrower problem-answer pair. The broader problem you touched upon yourself. You have to use custom code for everything else. You could use the custom code to handle user auth, but yes, you CAN use HTTP's facilities.

        SOAP gets rid of that custom code for everything else. No XML parsers, no comma delimit parsers, no mime64, uuencoding or urlencoding data. The spec covers that for you and kits as well in some form.