留言板

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

Frédéric Aubé,修改在9 年前。

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

Junior Member 帖子: 37 加入日期: 14-7-17 最近的帖子
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,修改在9 年前。

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

Liferay Legend 帖子: 1399 加入日期: 10-9-17 最近的帖子
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é,修改在9 年前。

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

Junior Member 帖子: 37 加入日期: 14-7-17 最近的帖子
Thank you very much

It works with class-pk and classPk
Traolly Xiong,修改在7 年前。

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

Regular Member 帖子: 195 加入日期: 11-12-30 最近的帖子
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.