Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
call custom portlet webservice
hi
i develop club portlet (custom portlet) in liferay 6.1 CA.
addScore method in ScoreServiceImpl is responsible to add score for remote systems (this method is web service method).
in this method i check permission. this method is:
public long addScore(long companyId,long groupId,long definitionId,String nationalCode,long score,String description)
throws PortalException, SystemException {
ClubPortletPermission.check(getPermissionChecker(), groupId, ActionKeys.WS_UPDATE);
// code for add score
}
in tomcat-users.xml i add this line:
<user username="10197" password="102030" roles="users"/>
for call this webservice i request this url:
http://userId:password@mydomain/club-portlet/api/secure/jsonws/score/add-score?companyId=10155&groupId=10181&definitionId=382604&nationalCode=4432300582&score=7&description=rrrr
when i request this url in permission check error occur:
in JSONServlet class :
remoteUser for portal webservices correctly return userId (that pass by URL), but with custom portlet URL remoteUser is null and this is root cause.
help me.
tanks
i develop club portlet (custom portlet) in liferay 6.1 CA.
addScore method in ScoreServiceImpl is responsible to add score for remote systems (this method is web service method).
in this method i check permission. this method is:
public long addScore(long companyId,long groupId,long definitionId,String nationalCode,long score,String description)
throws PortalException, SystemException {
ClubPortletPermission.check(getPermissionChecker(), groupId, ActionKeys.WS_UPDATE);
// code for add score
}
in tomcat-users.xml i add this line:
<user username="10197" password="102030" roles="users"/>
for call this webservice i request this url:
http://userId:password@mydomain/club-portlet/api/secure/jsonws/score/add-score?companyId=10155&groupId=10181&definitionId=382604&nationalCode=4432300582&score=7&description=rrrr
when i request this url in permission check error occur:
{"exception":"com.liferay.portal.security.auth.PrincipalException"}
if i don't check permission, addscore work correctly.in JSONServlet class :
String remoteUser = request.getRemoteUser();
remoteUser for portal webservices correctly return userId (that pass by URL), but with custom portlet URL remoteUser is null and this is root cause.
help me.
tanks
You're trying to mix tomcat authentication and Liferay authentication, those two things are completely different.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™