We have an old web application and would like to redo it as a web service, thus decoupling the main Perl implementation from the web presentation implementation. The idea is we can redo the UI in another language (Java seems to be the preference of the boss), but in my mind this exercise is useful even if we stick with Perl. Stripping out the HTML soup that is currently mixed with the code is going to be my job. Oh, joy.

But the part I am actually looking forward to is recasting this as a web service. I'm just having trouble figuring out what the modern best practices for creating web services are. The book Web Services with Perl (O'Reilly) came out six years ago, in 2002. A bit long in the tooth, maybe... is that book still a good reference?

Would prefer to do the API in a RESTful manner. The application is read / write, not just read, so writes will be done with posts. Is SOAP::Lite what I need? Or SOAP::Server? Or should I just skip SOAP altogether? I've used JSON on a project in the past and liked it; can it be part of a web services solution? (Not to say I like this hammer, now let me shape any problem into a nail, but JSON is a lot nicer to work with than, say, XML).

Am I even asking the right questions? Thoughts, anyone?


In reply to Web services: current best practices for server side? by dmorgo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.