4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

(QA) IWSのREST APIでJSON形式でデータを送受信できますか?

Posted at

首記ご質問をいただき調べてみました。
結果、IBM i 7.5, 7.6ではREST APIコールしたRPG,COBOLや、Db2 for i へのSQL実行結果をJSON形式で取得が可能です。

1.IWSからDb2 for i にSQLを実行した結果をJSONで取得

IWSのREST APIコール用サービスの設定で以下のようにJSON形式を指定します。
image.png

結果例はこちら

image.png

2.IWSからREST APIでILE RPGをコールした結果をJSONで取得

1.と同様にREST APIコール用サービス設定の出力結果のタイプにJSONを指定します。

下図は補足ですが、呼出しするILE RPGのパラメーターの設定個所です。
image.png
コールしたILE RPGのパラメーターに入出力用、出力専用、などを指定しています。(ILE RPGの仕様に合わせます)
image.png

結果例はこちら
image.png

4
0
5

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?