Fórum

Consuming REST services (Beginner)

Gasser M. Abdallah, modificado 6 Anos atrás.

Consuming REST services (Beginner)

New Member Postagens: 3 Data de Entrada: 23/08/17 Postagens Recentes
One of the backends is exposing its API as RESTFUL services.
These services are needed by several portlets.
So we thought to consume them from a service builder module and use the module from the portlets (like we do in database access).

The problem is that, we see many recommendation to use spring RESTTemplate to consume the rest services, but we can't use them in our service builder, are we missing something?

We thought of using spring portlets directly, but I want the REST client to be exposed to any current of future portlet without repeating the code in each portlet.
thumbnail
David H Nebinger, modificado 6 Anos atrás.

RE: Consuming REST services (Beginner)

Liferay Legend Postagens: 14919 Data de Entrada: 02/09/06 Postagens Recentes
Gasser M. Abdallah:
The problem is that, we see many recommendation to use spring RESTTemplate to consume the rest services, but we can't use them in our service builder, are we missing something?


Why not?

The biggest issue you face will be the use of "fake entities", a thing that I've blogged about and have championed in the past because it allows you to build out a "service layer" that is based on a general data sink instead of a specific database table.

That still applies in LR7/DXP, but you might also be able to leverage simple OSGi DS service implementations as well.
Gasser M. Abdallah, modificado 6 Anos atrás.

RE: Consuming REST services (Beginner)

New Member Postagens: 3 Data de Entrada: 23/08/17 Postagens Recentes
Hi David:

It turned out to be a spring version problem failing our SB, now its working and we can consume REST.

Thanks ,
Teddy Kossoko, modificado 5 Anos atrás.

RE: Consuming REST services (Beginner)

Junior Member Postagens: 42 Data de Entrada: 05/03/18 Postagens Recentes

Hi, I'm trying to consume my back end Rest services, but I don't know how to do.

What are the different steps to consume the rest web services ?

How did you do, to have the client exposed to all others portlets ?

Thanks in advance pour your answer.