留言板

Consuming REST services (Beginner)

Gasser M. Abdallah,修改在6 年前。

Consuming REST services (Beginner)

New Member 帖子: 3 加入日期: 17-8-23 最近的帖子
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,修改在6 年前。

RE: Consuming REST services (Beginner)

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
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,修改在6 年前。

RE: Consuming REST services (Beginner)

New Member 帖子: 3 加入日期: 17-8-23 最近的帖子
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,修改在5 年前。

RE: Consuming REST services (Beginner)

Junior Member 帖子: 42 加入日期: 18-3-5 最近的帖子

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.