Rest services trouble

Hi guys,

Having my first attempt at getting the rest services to work.
Keep getting back the following error:

23:11:14.626 INFO  c.h.c.c.sys.AbstractViewRepository - Initializing views
23:11:15.274 WARN  c.h.restapi.common.RestAuthUtils - Locale {} passed in the Accept-Language header is not supported by the application. It was ignored.
23:11:15.303 WARN  c.h.restapi.common.RestAuthUtils - Locale {} passed in the Accept-Language header is not supported by the application. It was ignored.
23:11:15.307 INFO  c.h.r.c.RestControllerExceptionHandler - RestAPIException: Service method not found, ecosmart_AccountService.getUninvoicedBalanceForAccountId(accountId)
23:11:15.308 INFO  c.h.r.c.RestControllerExceptionHandler - RestAPIException: Service method not found, ecosmart_AccountService.getUnpaidInvoicesTotalForAccountId(accountId)
23:11:15.326 WARN  c.h.restapi.common.RestAuthUtils - Locale {} passed in the Accept-Language header is not supported by the application. It was ignored.
23:11:15.329 INFO  c.h.r.c.RestControllerExceptionHandler - RestAPIException: Service method not found, ecosmart_AccountService.getUninvoicedBalanceForAccountId(accountId)
23:11:21.921 WARN  c.h.restapi.common.RestAuthUtils - Locale {} passed in the Accept-Language header is not supported by the application. It was ignored.
23:11:21.922 WARN  c.h.restapi.common.RestAuthUtils - Locale {} passed in the Accept-Language header is not supported by the application. It was ignored.
23:11:21.927 INFO  c.h.r.c.RestControllerExceptionHandler - RestAPIException: Service method not found, ecosmart_AccountService.getUninvoicedBalanceForAccountId(accountId,month)
23:11:21.928 INFO  c.h.r.c.RestControllerExceptionHandler - RestAPIException: Service method not found, ecosmart_AccountService.getUninvoicedBalanceForAccountId(accountId)

Rest service api settings look like follows:
> <?xml version="1.0" encoding="UTF-8"?>
> <services xmlns="http://schemas.haulmont.com/cuba/rest-services-v2.xsd">
> <service name="ecosmart_AccountService">
>     <method name="checkIfUnbilledTransactionsExistUptoDate">
>         <param name="items"/>
>     </method>
> </service>
> <service name="ecosmart_AccountService">
>     <method name="getUnpaidInvoicesTotalForAccountId">
>         <param name="accountId"/>
>     </method>
> </service>
> <service name="ecosmart_AccountService">
>     <method name="getUninvoicedBalanceForAccountId">
>         <param name="accountId"/>
>     </method>
> </service>
> <service name="ecosmart_AccountService">
>     <method name="getTotalSpendPerDayForMonthForAccountId">
>         <param name="accountId"/>
>         <param name="month"/>
>     </method>
> </service>
> </services>

I upgraded from 6.6 to 6.10 and the same error persists.

Any help/suggestions appreciated.

It was working when I had just one service. But seemed to stop when I added more.

Cheers

Hello @daryn

You should specify service methods in single <service/> tag:

<services xmlns="http://schemas.haulmont.com/cuba/rest-services-v2.xsd">
   <service name="ecosmart_AccountService">
       <method name="checkIfUnbilledTransactionsExistUptoDate">
           <param name="items"/>
       </method>
       <method name="getUnpaidInvoicesTotalForAccountId">
           <param name="accountId"/>
       </method>
       <method name="getUninvoicedBalanceForAccountId">
           <param name="accountId"/>
       </method>
       <method name="getTotalSpendPerDayForMonthForAccountId">
           <param name="accountId"/>
           <param name="month"/>
       </method>
   </service>
</services>

For further information please read our documentation: Services Configuration

Regards,
Daniil

Thank you for that.