legacy-knowledge-base
公開されました Sep. 10, 2025

LiferayでJSONウェブサービスをテストする

written-by

Justin Choi

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

learn-legacy-article-disclaimer-text

この記事では、Liferay Portal 6.1.xでAPIメソッドをテストするためのJavaScript Object Notation(JSON)ウェブサービスの新しい実装について説明します。 唯一の制限は、どのメソッドもテストするにはJSONを経由する必要があることです。

Hypersonicはテスト用であり、正確な結果が得られないため、APIテストにはHypersonic 以外のデータベースが必要となります。

解像度

テストを開始するには

  1. Liferay Portalを起動し、管理者としてログインする。
  2. ログイン後、 [YOUR_SITE]/api/jsonws に移動します(例: http://localhost:8080/api/jsonws)。
  3. 左はLiferayのAPI一覧です。 1つをクリックします。
    1. ここから、そのAPIのパス、パラメーター、リターンタイプ、例外情報が表示されます。 下には、データベース内の既存のデータを解析してその文字列を取り出す検索を実行することができます。
  4. メイン API テストページ-[YOUR_SITE]/api/jsonws から get-user-by-id をクリックします(例: http://localhost:8080/api/jsonws?signature=/user/get-user-by-id-1-userId)。
  5. 一番下の userId フォームに 10158と入力すると、Liferay のインストール時のデフォルトユーザーとなります。
  6. クリック 呼び出し

その結果、 Execute セクションに情報が入力されるはずです。

agreedToTermsOfUse": true, "comments":""、"companyId":10154, "contactId":10159, "createDate":1383249122000, "defaultUser": true, "emailAddress":"", "emailAddressVerified": false, "facebookId":0, "failedLoginAttempts":0、"firstName":""、"graceLoginCount":0、"greeting":"ようこそ!"、"jobTitle":"", "languageId": null, "lastFailedLoginDate": null, "lastLoginDate": null, "lastLoginIP":"", "lastName":"", "lockout": false, "lockoutDate": null "loginDate":1383249122000, "loginIP":"", "middleName":""、"modifiedDate":1383249122000, "openId":""、"portraitId":0, "reminderQueryAnswer":"", "reminderQueryQuestion":""、"screenName":"10158"、"status":0, "timeZoneId": null, "userId":10158, "uuid":"b6e14dd2-93a5-4ed2-b8d6-f294e6e79724" }

追加情報

Liferay Portal 6.2 ユーザーガイド: Liferay サービスにリモートアクセスする

did-this-article-resolve-your-issue

legacy-knowledge-base