Hello,
I have created some restapi service and methods which are working fine till 3-4 days back but suddenly the method names are not being recognised and giving following error
My service call from postman is this:
http://localhost:8080/rest/services/bpsService/sitePostsCount?projectID=323b052a-2d39-8bfa-bbcf-4f1891b8b76a
The error is as follows;
{
"error": "Service method not found",
"details": "bpsService.sitePostsCount(projectID)"
}
The rest-service.xml file is as follows;
<?xml version="1.0" encoding="UTF-8"?>
<services xmlns="http://jmix.io/schema/rest/services">
<service name="bpsService">
<method name="sitePostsCount">
<param name="projectID"/>
</method>
</service>
<service name="bpsService">
<method name="addInspectionItemsFromGroup">
<param name="inspectionID"/>
<param name="tGroupID"/>
</method>
</service>
<service name="bpsService">
<method name="addTestParametersFromGroup">
<param name="testSampleID"/>
<param name="testMaterialID"/>
</method>
</service>
</services>
The implementation is as follows;
@Service("bpsService")
public class bpsService {
@Autowired
private Metadata metadata;
@Autowired
private DataManager dataManager;
public Integer sitePostsCount (UUID projectID){
List<SiteActivity> listSA = dataManager.load(SiteActivity.class)
.query("select e from SiteActivity e where e.site.project.id = :projectID")
.parameter("projectID", projectID)
.list();
Integer spCount = listSA.size();
return spCount;
}
// some other methods
}
The application.properties file have this line
jmix.rest.services-config = rest-services.xml
Please guide.
Thanks