<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>call custom portlet webservice</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=118084381" />
  <subtitle>call custom portlet webservice</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=118084381</id>
  <updated>2026-04-05T15:50:29Z</updated>
  <dc:date>2026-04-05T15:50:29Z</dc:date>
  <entry>
    <title>RE: call custom portlet webservice</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118091668" />
    <author>
      <name>David H Nebinger</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118091668</id>
    <updated>2019-12-16T14:53:05Z</updated>
    <published>2019-12-16T14:53:05Z</published>
    <summary type="html">You&amp;#39;re trying to mix tomcat authentication and Liferay authentication, those two things are completely different.</summary>
    <dc:creator>David H Nebinger</dc:creator>
    <dc:date>2019-12-16T14:53:05Z</dc:date>
  </entry>
  <entry>
    <title>call custom portlet webservice</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118084380" />
    <author>
      <name>mokhtar hatampoor</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=118084380</id>
    <updated>2019-12-15T10:14:12Z</updated>
    <published>2019-12-15T10:14:12Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;hi&lt;br&gt;i develop club portlet (custom portlet)&amp;nbsp; in liferay 6.1 CA.&lt;br&gt;addScore method in ScoreServiceImpl is responsible to add score for remote systems (this method is web service method).&lt;br&gt;in this method i check permission. this method is:&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public long addScore(long companyId,long groupId,long definitionId,String nationalCode,long score,String description)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throws PortalException, SystemException {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ClubPortletPermission.check(getPermissionChecker(), groupId, ActionKeys.WS_UPDATE);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // code for add score&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;}&lt;br&gt;&lt;br&gt;in tomcat-users.xml i add this line:&lt;br&gt;&amp;nbsp; &amp;lt;user username="10197" password="102030" roles="users"/&amp;gt;&lt;br&gt;for call this webservice i request this url:&lt;br&gt;&lt;a href="mailto:http://10197:102030@hatam.ir/club-portlet/api/secure/jsonws/scoredetail/add-score-detail?companyId=10155&amp;amp;groupId=10181&amp;amp;definitionId=382604&amp;amp;nationalCode=4432300582&amp;amp;score=7&amp;amp;description=rrrr"&gt;http://userId:password@mydomain/club-portlet/api/secure/jsonws/score/add-score?companyId=10155&amp;amp;groupId=10181&amp;amp;definitionId=382604&amp;amp;nationalCode=4432300582&amp;amp;score=7&amp;amp;description=rrrr&lt;/a&gt;&lt;br&gt;when i request this url in permission check error occur:&lt;br&gt;&lt;pre&gt;&lt;code&gt;{"exception":"com.liferay.portal.security.auth.PrincipalException"}&lt;/code&gt;&lt;/pre&gt; &amp;nbsp; if i don't check permission, addscore work correctly.&lt;br&gt;in&amp;nbsp; JSONServlet&amp;nbsp; class :&lt;br&gt;&lt;pre&gt;&lt;code&gt;String remoteUser = request.getRemoteUser();
&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;remoteUser for portal webservices correctly return userId (that pass by URL), but with custom portlet URL&amp;nbsp; remoteUser&amp;nbsp; is null and this is root cause.&lt;br&gt;help me.&lt;br&gt;tanks&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>mokhtar hatampoor</dc:creator>
    <dc:date>2019-12-15T10:14:12Z</dc:date>
  </entry>
</feed>
