how to Invoking JSON Web Services with Parametershow to Invoking JSON Web Services with Parametershttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1214205912024-03-28T09:45:27Z2024-03-28T09:45:27ZRE: how to Invoking JSON Web Services with ParametersScarletake Bwihttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1214206462022-05-11T08:20:29Z2022-05-11T08:20:13Z<p>i solve this problem</p>
<p>the error is in name of hidden, it should as same as method, so it
shuld be jsonInfo.</p>Scarletake Bwi2022-05-11T08:20:13Zhow to Invoking JSON Web Services with ParametersScarletake Bwihttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1214205902022-05-11T04:29:36Z2022-05-11T04:29:34Z<p>hi </p>
<p>i create a Rest service via service builder. </p>
<pre>
<code class="language-java">@AccessControlled(guestAccessEnabled = true)
@JSONWebService
public JSONObject feedback(String jsonInfo) throws SystemException, PortalException {
....</code></pre>
<p>after deploy, the service can be found in api/jsonws</p>
<p>i try invoke the service, and because the jsonInfo is very long, i
cannot pass it as part of url path. </p>
<p>i try pass it as object, <a href="https://help.liferay.com/hc/en-us/articles/360017899652-Invoking-JSON-Web-Services#object-parameters">Invoking-JSON-Web-Services#object-parameters</a></p>
<pre>
<code class="language-java"><form method="post" action="http://localhost:8080/api/jsonws/snm.record/feedback/+json-info">
<input type="hidden" name="+json-info" value="test"/>
<button type="submit" >submit</button>
</form></code></pre>
<p>the service be called, but jsonInfo always get empty.</p>
<p>and if without plus(+), it is missing.</p>
<blockquote>
<p>{"exception":"Missing value for parameter
json-info","throwable":"java.lang.IllegalArgumentException:
Missing value for parameter
json-info","error":{"message":"Missing
value for parameter json-info","type":"java.lang.IllegalArgumentException"}}</p></blockquote>
<p> i do not know w