Cookies help us deliver our services.

By using our services, you agree to our use of cookies. Learn more

I understand

Who uses Liferay Service Builder knows that it's possible to generate both a local services layer, ie callable by the local JVM, and a remote services layer, that is accessible from a remote JVM typically via web services (REST or SOAP).

The default behaviour is that all methods found in the *ServiceImpl class will be exposed as a web service ones; so let's see how to prevent a single method to be exposed as a service.

Well, the procedure is very simple because it's sufficient to annotate the method as follows:

@JSONWebService(mode = JSONWebServiceMode.IGNORE)
public long methodToHide(...) {

Then simply run the usual Ant target build-service and that's it: the Java method will no longer be exposed as REST method.