REST routing questions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

REST routing questions

BrunoBB
Hi,

I have a REST package working fine:
WARestfulHandler
   WAOrbeonPersistenceApiService

Now that all routes and services are working OK, i want to connect the services to "real" classes.

To do this i create another class:
WARestfulHandler
   WAOrbeonPersistenceLayer

Where the PATH of the services (of WAOrbeonPersistenceLayer) are the same as WAOrbeonPersistenceApiService but the implementation of the service use "real classes".

To avoid PATH clash:
WAAdmin unregister: 'gemstone-orbeon-api'. "app: WAOrbeonPersistenceApiService "
WAAdmin register: WAOrbeonPersistenceLayer asApplicationAt: 'orbeon-gemstone-api'.

But now when a service is called (with the same path) i get a 501 error.

Is possible that a path clash could be happening ?
Does #unregister: remove the instances of WAOrbeonPersistenceApiService ?

Regards,
Bruno

Reply | Threaded
Open this post in threaded view
|

Re: REST routing questions

BrunoBB
Hi All,

Solved !!! "the danger of doing copy/paste mechanically"

"For Services use #register:at: (at: !!!)"
WAAdmin register: WAOrbeonPersistenceLayer at: 'orbeon-gemstone-api'.

"For Applications use #register:asApplicationAt: (asApplicationAt: !!!)"
WAAdmin register: WAOrbeonLogin asApplicationAt: 'orbeon'.

I was accidentally sending #register:asApplicationAt: to a subclass of WARestfulHandler so when evaluating:
(WAAdmin defaultDispatcher handlerAt: '/orbeon-gemstone-api') "answer aWAApplication"

After the answer was "aWAApplication" i found my error :)

Regards,
Bruno
Reply | Threaded
Open this post in threaded view
|

Re: REST routing questions

BrunoBB
Hi,

Forgot to mention for the record, to know the path matches evaluate:

(WAAdmin defaultDispatcher handlerAt: '/your-app-name') routes.

Regards,
Bruno