Polymer UI and calls to REST services

Good afternoon,

I am starting to develop my app with CUBA and Polymer UI. Now I want to integrate my Java code to call from this app to some REST services and be able to collect data to show them later. Can someone give me a hand or give me an example that can be followed easily?

Thank you very much,
Greetings.

1 Like

Hello, @jordi.gisbert.ponsoda

First of all you have to configure your app to invoke service methods via REST. It is described here: Services Configuration.

Then, you can use the cuba-service component in Polymer UI: cuba-elements.github.io.

And here is small example.

Configure component:

<cuba-service id="someService"
                service-name="demo_DemoService"
                method="doSomething"
                auto="false">
</cuba-service>

Use component:

this.$.someService.load().then(function (result) {
  this.data = result;
}.bind(this));

Regards,
Daniil