Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Akram MONCER
*LocalServiceUtil VS *ServiceUtil
January 23, 2013 9:53 AM
Answer

Akram MONCER

Rank: Regular Member

Posts: 106

Join Date: September 25, 2012

Recent Posts

hi any one know what is the difference between *LocalServiceUtil and *ServiceUtil ?

like for example UserLocalServiceUtil and UserServiceUtil

thanks
Gaurav Jain
RE: *LocalServiceUtil VS *ServiceUtil
January 23, 2013 11:00 AM
Answer

Gaurav Jain

Rank: Regular Member

Posts: 141

Join Date: January 31, 2011

Recent Posts

Check the following post:

http://www.liferay.com/web/jorge.ferrer/blog/-/blogs/liferay-s-architecture-the-service-layer
Hitoshi Ozawa
RE: *LocalServiceUtil VS *ServiceUtil
January 23, 2013 2:34 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

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
RE: *LocalServiceUtil VS *ServiceUtil
January 24, 2013 12:11 AM
Answer

Akram MONCER

Rank: Regular Member

Posts: 106

Join Date: September 25, 2012

Recent Posts

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
Hitoshi Ozawa
RE: *LocalServiceUtil VS *ServiceUtil
January 25, 2013 4:42 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

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
RE: *LocalServiceUtil VS *ServiceUtil
January 25, 2013 6:05 AM
Answer

Akram MONCER

Rank: Regular Member

Posts: 106

Join Date: September 25, 2012

Recent Posts

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.