Legacy Knowledge Base
公開されました Sep. 10, 2025

認証されていないユーザーは、Jsonウェブサービスを見ることができません。

Written By

Prarthana Jadhav

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

問題

  • 認証されていない(Guest)ユーザーで http://localhost:8080/api/jsonws にアクセスし、コンテキストパスを選択すると、「Access denied」エラーが発生します。
  • 例えば、シンプルなサービスビルダーモジュールを作成し、デフォルトのままではFOOが作成されます。

    • FooServiceImplの中に、簡単な getData() メソッドを記述し、このモジュールをビルドしてデプロイする。

    • デプロイ後、認証されていないユーザーとして http://localhost:8080/api/jsonws を開き、コンテキスト名を foo と選択 ->getData をクリック ->Invoke をクリックします。 以下のようなエラーが発生します;

      "Access denied to com.liferay.ws.service.FooService#getData"

環境

  • Liferay DXP 7.1

解決策

    • 上記のエラーは、次の手順に従って解決できます。
      1)[コントロールパネル]に移動します>構成>サービスアクセスポリシー
      2)「+」アイコンをクリックして新しいポリシーを追加します。
      3)「有効」と「デフォルト」を確認します。チェックボックス。
      4)公開する必要のあるクラス名とメソッド名とともに、名前とタイトルを入力して保存します。 下図をご参照ください。

      例.PNG
  • これで、未認証のユーザーが新しく作成されたWebサービスにアクセスできるようになります。
Did this article resolve your issue ?

Legacy Knowledge Base