Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scala: Simple webservice

I'd like to create a simple webservice in scala similar to:

http://www.artima.com/lejava/articles/threeminutes.html

Is there an easy way to do this?

EDIT: I found a tutorial for lift http://wiki.liftweb.net/index.php/HowTo_do_Web_Services. However this seems to be way too complicated for what I'm looking for.

like image 835
Chris Avatar asked May 18 '10 07:05

Chris


2 Answers

Can't you just "port" that example to Scala? Importing and using Java classes should "just work", as should annotations (see http://www.scala-lang.org/node/106 for more details on those). Then it's just a case of invoking the framework as normal, which should pick up your Scala class just as it would a Java one (it's all JVM bytecode, after all...).

Or am I missing something?

like image 196
pdbartlett Avatar answered Sep 19 '22 06:09

pdbartlett


Might be a bit of a late reply for you, but for future reference, there I've posted a very short snippet that should do what you need here: http://scalabound.org/?p=179 Good luck !

like image 40
kings Avatar answered Sep 20 '22 06:09

kings