Foros de discusión

*LocalServiceUtil VS *ServiceUtil

Akram MONCER, modificado hace 11 años.

*LocalServiceUtil VS *ServiceUtil

Regular Member Mensajes: 106 Fecha de incorporación: 25/09/12 Mensajes recientes
hi any one know what is the difference between *LocalServiceUtil and *ServiceUtil ?

like for example UserLocalServiceUtil and UserServiceUtil

thanks
thumbnail
Gaurav Jain, modificado hace 11 años.

RE: *LocalServiceUtil VS *ServiceUtil

Regular Member Mensajes: 145 Fecha de incorporación: 31/01/11 Mensajes recientes
Check the following post:

http://www.liferay.com/web/jorge.ferrer/blog/-/blogs/liferay-s-architecture-the-service-layer
thumbnail
Hitoshi Ozawa, modificado hace 11 años.

RE: *LocalServiceUtil VS *ServiceUtil

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
Simply put, localServiceUtil is a local service and does not require user/password authentication while ServiceUtil is a remote service and require user/password authentication.
Akram MONCER, modificado hace 11 años.

RE: *LocalServiceUtil VS *ServiceUtil

Regular Member Mensajes: 106 Fecha de incorporación: 25/09/12 Mensajes recientes
hi hitoshi thanks for replay
but when i use a ServiceUtil i works only for the admin if i try it for a simple use i get this exception :
com.liferay.portal.security.auth.PrincipalException
at com.liferay.portlet.shopping.service.permission.ShoppingPermission.check(ShoppingPermission.java:31)

how can change it whitout using the LocalServiceUtil
thumbnail
Hitoshi Ozawa, modificado hace 11 años.

RE: *LocalServiceUtil VS *ServiceUtil

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
Give the user which you have logged in a permission. I'm not exactly sure what's you're trying to do. What's the exact method you're trying to use?
Akram MONCER, modificado hace 11 años.

RE: *LocalServiceUtil VS *ServiceUtil

Regular Member Mensajes: 106 Fecha de incorporación: 25/09/12 Mensajes recientes
hi thanks hitoshi for your response
i try to use something like this ShoppingCouponServiceUtil.addCoupon(code, autoCode, name, description, startDateMonth, startDateDay, startDateYear, startDateHour, startDateMinute, endDateMonth, endDateDay, endDateYear, endDateHour, endDateMinute, neverExpire, active, limitCategories, limitSkus, minOrder, discount, discountType, serviceContext)
but only the admin can excute it how can i give the right to a normal user to execute it.