Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Combining a web application and a REST application under a single URI?

by Asim (Hermit)
on Jul 28, 2006 at 16:57 UTC ( [id://564394]=note: print w/replies, xml ) Need Help??


in reply to Combining a web application and a REST application under a single URI?

Have ye considered the Catalyst framework for all of this? There's a somewhat out-of-date Catalyst tutorial that does an app with both HTML and XMLRPC interfaces. Swap in one of the Catalyst::View::REST-style interfaces for XMLRPC, and with some digging, it might be adaptable to your needs. I know you can get the header information in Catalyst fairly easily, and call Private functions within it for your seamless front-end.

Edit: Looks like the Catalyst Cookbook covers XMLRPC, as well, taking ideas and examples from the above link.

Does that sound useful for you?

----Asim, known to some as Woodrow.

  • Comment on Re: Combining a web application and a REST application under a single URI?

Replies are listed 'Best First'.
Re^2: Combining a web application and a REST application under a single URI?
by talexb (Chancellor) on Jul 28, 2006 at 21:02 UTC

    I tried to wrap my brain around Catalyst, spending about a week reading the docs and trying the examples, then about another week doing the same with DBIx::Class. I also visited the Catalyst and DBIx::Class IRC channels, getting some excellent assistance from our own castaway and Matt S. Trout (mst), among others.

    Ultimately, I just wasn't able to 'get' how to use Catalyst or DBIx::Class. That's not necessarily a shortcoming of either package or their respective (overlapping) user communities. In fact, I owe those folks a beer or three for all their help.

    I've now had a look at REST::Application and set that aside as well -- it looked very nice, but it ties in with Apache 1.3, something I didn't realize until I started trying to get the examples to work. I'm currently using Apache 2.0, and will probably go with Apache 2.2 since I believe the target OS is FC5. I'm now at the point where I'm probably going to use CGI::Application along with Apache's rewrite engine so that REST style URIs are mapped to CGI equivalents -- the REST URLs will get XML, and the normal URLS will get HTML. My prototyping has developed paralell page templates for the two formats, so I'll use one piece of logic to service the request, then present the results in the appropriate format.

    I'll be using CGI::Session for authentication, hopefully by way of CGI::Application::Session, and I'll be using cookies instead of trying to cram session information into URLs.

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://564394]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2024-04-20 05:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found