Foren

REST WS

thumbnail
Ehsan Rashidy, geändert vor 9 Jahren.

REST WS

New Member Beiträge: 17 Beitrittsdatum: 24.04.13 Neueste Beiträge
Hi
I'm going to develope a RESTful ws,
and I'm wondering how can I implement it, so I made some questions:

Which one is better, using a third party framework(such as spring framework) or liferay built-in api? and
Which one is the better solution, Portal Web Service or Plugin Portlet Web service?

regards.
thumbnail
David H Nebinger, geändert vor 9 Jahren.

RE: REST WS

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
Question - Which is better, hot or code, dog or cat, horse or donkey?

Answer - They are each better in different circumstances. Without some contextual background, 'better' has no meaning.
thumbnail
Ehsan Rashidy, geändert vor 9 Jahren.

RE: REST WS

New Member Beiträge: 17 Beitrittsdatum: 24.04.13 Neueste Beiträge
ok, you are right, my question was not enough obvious,
I'm new to liferay, so I'm looking for the easiest way to implement the service also I have to implement it as soon as possible.
so the "time" and the "way of implementation" are important to me.

regards.
thumbnail
David H Nebinger, geändert vor 9 Jahren.

RE: REST WS

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
Right, but there's still not enough context...

Will your web service be exposing liferay entities, or is it a plain rest implementation?

Me, I like using a straight spring rest servlet and invoke whatever I want (liferay or otherwise), but it comes with caveats that may or may not be appropriate for you.
thumbnail
Pier Paolo Ramon, geändert vor 9 Jahren.

R: REST WS

Junior Member Beiträge: 90 Beitrittsdatum: 25.05.10 Neueste Beiträge
Given the use of the Service Builder or builtin entities, I'd go with JSON WS and forget about a real REST API. My two cents, cost aware.

Sent from my iPhone with Liferay.com Forums
thumbnail
Ehsan Rashidy, geändert vor 9 Jahren.

RE:REST WS

New Member Beiträge: 17 Beitrittsdatum: 24.04.13 Neueste Beiträge
Thank you for your replies David and Paolo,

We have a portlet which has a seperate database resides next to liferay portal's one
(in the production enviroment they should reside in the same DB server, but now in development enviroment they are in two different servers)
and the service will expose the data of one of the tables.
The service should only gets an id and returns the associated row,
in addition, it should be a secured service so that the client should be authenticated to use it.

regards
thumbnail
Nitesh Kr Sahay, geändert vor 9 Jahren.

RE: REST WS

Junior Member Beiträge: 58 Beitrittsdatum: 28.11.11 Neueste Beiträge
I think you should create a seperate web service using Rest or Soap and call from liferay plugin as a client.
I am not getting anything in your provided scenario where liferay 'll be best suited to create and publish web service for your outer service.
thumbnail
Ehsan Rashidy, geändert vor 9 Jahren.

RE: REST WS

New Member Beiträge: 17 Beitrittsdatum: 24.04.13 Neueste Beiträge
Nitesh Kr Sahay:
I think you should create a seperate web service using Rest or Soap and call from liferay plugin as a client.
I am not getting anything in your provided scenario where liferay 'll be best suited to create and publish web service for your outer service.


Nitesh, What's the point of creating a seperate service?
I prefer to create the service inside the portlet, because I can use the existing SessionFactoy Object which I have in there,
if I create a seperate service I have to create an additional Object.
thumbnail
Pier Paolo Ramon, geändert vor 9 Jahren.

R: REST WS

Junior Member Beiträge: 90 Beitrittsdatum: 25.05.10 Neueste Beiträge
Is the portlet developed using the ServiceBuilder?

Sent from my iPhone with Liferay.com Forums
thumbnail
Ehsan Rashidy, geändert vor 9 Jahren.

RE: R: REST WS

New Member Beiträge: 17 Beitrittsdatum: 24.04.13 Neueste Beiträge
Pier Paolo Ramon:
Is the portlet developed using the ServiceBuilder?

Sent from my iPhone with Liferay.com Forums


No, Portlet is not developed by ServiceBuilder.
thumbnail
Ehsan Rashidy, geändert vor 9 Jahren.

RE: R: REST WS

New Member Beiträge: 17 Beitrittsdatum: 24.04.13 Neueste Beiträge
I was following this tutorial and finally I implemented the service with the help of Spring and Liferay PorletDelegateServlet class.

regards.