Glad you were able to figure it out.
If your SQL Stored Procedure is called repeatedly within the job, you should add the PROGRAM TYPE SUB option to your definition to improve performance.
Original Message:
Sent: Tue July 26, 2022 03:33 AM
From: Dennis Nel
Subject: IWS - SQL as a Web service - calling a SQL procedure and returning a result set
I have managed to solve the issue.
You need to specify the Allowed input media type when configuring the HTTP request method
In this case I was specifying the input parameters in the body as JSON and specified the input media type as such

------------------------------
Dennis Nel
Original Message:
Sent: Mon July 25, 2022 08:48 AM
From: Dennis Nel
Subject: IWS - SQL as a Web service - calling a SQL procedure and returning a result set
We are currently converting our SQL stored procedures to a REST web service "call" via IWS and SQL.
The stored procedure accepts 3 parameters, calls an RPG program that will insert records into a table and then the stored procedure returns a result set.
When I "hard code" the call in the SQL REST service, I get the result set returned.
BUT, when I parameterize the SQL REST service call, I get a 415 "Unsupported Media Type" message (testing via Postman).
What should I change on the SQL REST service configuration (if any) to get the "parameterized" call to return the result set?
Thanks for your assistance
Here is the code for the SQL stored procedure

IWS configuration for the "hard-coded" SQL call and the result set returned.



And the IWS configuration for the "parameterized" SQL call.



------------------------------
Dennis Nel
------------------------------