[Seaside] SeaSide REST

Johan Brichau johan at inceptive.be
Fri Oct 31 07:03:06 UTC 2014

Hi Rubens,

On 31 Oct 2014, at 02:36, Rubens Gomes <rubens.s.gomes at gmail.com> wrote:

> I am learning Smalltalk, and I am developing a REST service on top of Pharo 3 with Latest update #30859.  I have installed the latest SeaSide   I have done a Manual Installation of the most recent Configuration of SeaSide.  And I have installed the latest SeaSide30Addons.  I would like to ask a few questions:

When you say “latest”, which is that? Just to be sure that you did not load incompatible things:
Note that the Seaside-REST package is included in Seaside 3.1 and should not be loaded from the separate ConfigurationOfSeasideRest (which is for Seaside 3.0 only).

You should load the ‘REST’ group from the ConfigurationOfSeaside3, and probably also the ‘JSON’ group:

(ConfigurationOfSeaside3 project version: #’release3.1’) load: #(‘Core’ ‘REST’ ‘JSON’)

> 1) Why do I see this error in SeaSide, and how do I fix it?  I have the latest SeaSide running on latest Pharo 3 with Seaside-REST
> http://localhost:8080/
> Error: you are forbidden to access “/"

Which adaptor are you using? Does the Seaside tool show that it has started? Did you ever see the ‘Welcome to Seaside’ webpage?
I have the impression that Seaside was not started yet or that something else has been wrongly configured.

> 2) I have a Seaside REST object  that is not responding to the URL request below.
> http://localhost:8080/weight/kg?lb=10
> I have the following class/instance configuration.  Am I missing something else?
> WARestfulHandler subclass: #WeightRestHandler
> its class initialize method contains:
> WAAdmin register: self at: self 'weight’.

That does not seem to be correct. There is a ’self’ too much, it should be:	WAAdmin register: self at: ‘weight’
Did you execute this? Mind that a class initialize method is only executed when the class is loaded.

> And it has an instance method "weight" with following annotation:
> <get>
> <produces: 'text/json'>
> <path: '/{toUnit}?{fromUnit}={aNumber}’>

Looks reasonable, but probably you did not add the arguments to the method itself. 
But before we focus on this, let’s get the other issues out of the way and make sure Seaside works.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20141031/67f81f37/attachment.htm

More information about the seaside mailing list