I have successfully read data from my REST API call. However, when I try to use POST method to execute a service method I am getting the following Exception from my application log (server side):
06:34:25.559 INFO c.h.a.r.a.c.RestControllerExceptionHandler - RestAPIException: Service method not found, erp_WorkflowService.approveTask()
Here is my Service method:
@Override
@Transactional
public void approveTask(String workflowTaskNumber){
EntityManager em = persistence.getEntityManager();
WorkflowTaskLine workflowTaskLine = em.createQuery("select e from erp_WorkflowTaskLine e " +
"where e.workflowTaskNumber = ?1 ", WorkflowTaskLine.class)
.setParameter(1, workflowTaskNumber)
.getFirstResult();
approveTask(workflowTaskLine.getId());
}
Here is How I exposed the service in REST
<service name="erp_WorkflowService">
<method name="getWorkflowTaskLineList">
</method>
<method name="approveTask">
<param name="workflowTaskNumber" type="java.lang.String"/>
</method>
</service>
And REST call from client-side:
Uri.parse(constant.server_rest_path +
'services/erp_WorkflowService/approveTask?workflowTaskNumber=$workflowTaskNumber'),
Is there any mistake in the code or is there any specific user authorization for the user to REST services apart from access to the table as a REST user and the following?
Thanks for suggesting how this can be fixed.