Rest api, services bean

Hi, I am trying to use rest-services.xml

Follow the next step of I am doing:
1.) Create Interface and Bean Services

package net.ezmovil.ezinfo.service;

import net.ezmovil.ezinfo.entity.Dpi;

public interface DpiService {
    String NAME = "ezinfo_DpiService";

    String dpiByFacesId(String faceid);
    String Test(String faceid);


package net.ezmovil.ezinfo.service;

import com.haulmont.cuba.core.EntityManager;
import com.haulmont.cuba.core.Persistence;
import com.haulmont.cuba.core.Transaction;
import org.springframework.stereotype.Service;

import javax.inject.Inject;

public class DpiServiceBean implements DpiService {

    private Persistence persistence;

    public String dpiByFacesId(String faceid) {
        String _faceid = null;
        try (Transaction tx = persistence.createTransaction()) {
            EntityManager em = persistence.getEntityManager();
            _faceid = (String) em.createQuery("select cui_id from ezinfo$Faces f where = :faceid")
                    .setParameter("faceid", faceid)

        return _faceid;

    public String Test(String faceid) {
        String _return = "Hola ezMovil";
        return _return;


<?xml version="1.0" encoding="UTF-8"?>
<services xmlns="">
    <service name="ezinfo_DpiService">
        <method name="Test">
            <param name="stringParam" type="java.lang.String"/>
</services> = +net/ezmovil/ezinfo/rest-services.xml = client = secret = 300 = 20971520

2.) Consume LOGIN v2 REST API
Headers , Body …
This returm me the token

3.) Consume my Services

Authorization : Bearer acb8ff15-b58c-4507-8fe1-4368d3d144c0
Content-type : application/json

Return me:

“error”: “Service method not found”,
“details”: “ezinfo_DpiService.Test()”

Guys , what do you think I am doing bad ?
I use the documentation from 6.4.

Hi guys, I setup “rest-services.xml” under main root package but this directory under web have other “web” name directory, where exactly could be the “rest-services.xml” ?


You should pass stringParam parameter e.g:

Thanks Vlad, i consume using this but thas its like GET and works well, but how is using POST, do you have other example.


In case of POST you need to send JSON in request body:

  "stringParam": "foo"