Forums de discussion

JSON - No JSON web service action associated with path...

Frédéric Aubé, modifié il y a 9 années.

JSON - No JSON web service action associated with path...

Junior Member Publications: 37 Date d'inscription: 17/07/14 Publications récentes
Hi,
I would like to use Liferay's web service from http://localhost:8080/api/jsonws
Sometimes it works, sometimes it doesnt.

For example:
- get-user-by-id, get-user-organizations: I can call it by URL or by the button "invoke". It works
- get-json-data, get-phones: with the button "invoke", i have the answer that i'm looking for. Then, they give me an example URL with the same parameters.

When i try that URL http://localhost:8080/api/jsonws/expandovalue/get-json-data/company-id/10154/class-name/com.liferay.portal.model.User/table-name/CUSTOM_FIELDS/column-name/Bureau/classpk/10434
i've got this:
{"exception": "No JSON web service action associated with path /expandovalue/get-json-data and method GET for /"}


I posted my question in the French forum, none could help me.
Someone ask me to check the URL and try with className, tableName or columnName. Same issue.

I'm sorry for my English... i hope you can understand me.
thumbnail
James Falkner, modifié il y a 9 années.

RE: JSON - No JSON web service action associated with path...

Liferay Legend Publications: 1399 Date d'inscription: 17/09/10 Publications récentes
Frédéric Aubé:
Hi,
I would like to use Liferay's web service from http://localhost:8080/api/jsonws
Sometimes it works, sometimes it doesnt.

For example:
- get-user-by-id, get-user-organizations: I can call it by URL or by the button "invoke". It works
- get-json-data, get-phones: with the button "invoke", i have the answer that i'm looking for. Then, they give me an example URL with the same parameters.

When i try that URL http://localhost:8080/api/jsonws/expandovalue/get-json-data/company-id/10154/class-name/com.liferay.portal.model.User/table-name/CUSTOM_FIELDS/column-name/Bureau/classpk/10434
i've got this:
{"exception": "No JSON web service action associated with path /expandovalue/get-json-data and method GET for /"}


I posted my question in the French forum, none could help me.
Someone ask me to check the URL and try with className, tableName or columnName. Same issue.

I'm sorry for my English... i hope you can understand me.


Try to use class-pk or classPk instead of classpk. For example

http://localhost:8080/api/jsonws/expandovalue/get-json-data/company-id/10154/class-name/com.liferay.portal.model.User/table-name/CUSTOM_FIELDS/column-name/Bureau/class-pk/10434


It's an unfortunate consequence of this particular service method having a parameter called classPK which does not follow the "camel case" format of others (e.g. className, companyId). So Liferay normalizes it to classPk, and then tries to compare it to the incoming argument list (which is 'classpk') and it fails. So if you use class-pk, then Liferay removes the - and camel-cases the P, so it will match the actual method parameter name. Also, using classPk literally will match it.

See LPS-31357 and this thread.
Frédéric Aubé, modifié il y a 9 années.

RE: JSON - No JSON web service action associated with path...

Junior Member Publications: 37 Date d'inscription: 17/07/14 Publications récentes
Thank you very much

It works with class-pk and classPk
Traolly Xiong, modifié il y a 7 années.

RE: JSON - No JSON web service action associated with path...

Regular Member Publications: 195 Date d'inscription: 30/12/11 Publications récentes
I'm experiencing similar issue with a remote web service call. It works for a different primary column and it doesn't for another.

ex)

This does NOT work. http://localhost:8080/api/jsonws/qad-request-portal-portlet.altiris/get-a-record-by-id/id/1259

Error: 20:24:01,883 ERROR [http-bio-8080-exec-151][JSONWebServiceServiceAction:97] No JSON web service action associated with path /altiris/get-a-record and method GET for //qad-request-portal-portlet

This works: http://localhost:8080/api/jsonws/qad-request-portal-portlet.altiris/get-a-record-by-name/name/abc

How would I use the pk class in this instance?

Any other thoughts on what the issue could be?

Thanks in advance.