Send an entity to rest-service

I registered rest-services.xml in
like this = +kz/ensoft/portal/rest-services.xml

In rest-services.xml I point portal_RequestJoinService in such way

<?xml version="1.0" encoding="UTF-8"?>
<services xmlns="">
    <service name="portal_RequestJoinService">
        <method name="sendRequestJoin">
            <param name="requestJoin"/>
        <method name="sendLogTest">

This is how looks like

public interface RequestJoinService {
    String NAME = "portal_RequestJoinService";
    void sendRequestJoin(RequestJoin requestJoin);
    void sendLogTest();

Finally, I gotta an edit page called portal-request-join-edit.html. It was created using cuba-studio via
Polimer UI → New → Entity-Management → Select appropriate views and tap on ‘Create’ button.

I tried to invoke service using'portal_RequestJoinService', 'sendRequestJoin', this.entity)

but it sends all the fields of this entity separately, not the entity itself.

Please, help to pass entity correctly.

I create another method sendLogTest() it takes no parameters.
And when i inkove it, it works perfectly. That’s why i think there is no problem in configurations.

Maybe it would be better to @minaev answer this issue, because he already resolved another my ticket and he is kind of familiar with portal-request-join-edit.html.
Actually, he made a big contribution to it and i’m very grateful for him. Again, thank you Vald!

Hi, method parameter name is requestJoin so you should pass data in the following way:'portal_RequestJoinService', 'sendRequestJoin', {requestJoin: this.entity})
1 Like