user3364181
user3364181

Reputation: 541

Liferay json web service: url access not working?

I am creating an Liferay 6.2 json web services. I created remote web service :

public String getUrl(String Urn) throws SystemException{
        String url = "";
        try{
            Urn urn = UrnLocalServiceUtil.getUrnsByUrnCode(Urn);
            return urn.getWholePath();
        }catch(NoSuchUrnException e){
            return url;
        }
    }

Webservice is working correctly if used from the web interface on : http://localhost:8080/api/jsonws/

In tab result i get good and expected result. When i click on tab "Url example" i get this url : "http://localhost:8080/api/jsonws/URN-portlet.urn/get-url/urn/URN%3ANBN%3ANBS%3ADSC%3A00000004" but when i try to access it i get this message :

{"exception":"No JSON web service action associated with path /urn/get-url and method GET for //URN-portlet"}

What means the error obtained?

Upvotes: 0

Views: 1322

Answers (1)

Daniele Baggio
Daniele Baggio

Reputation: 2257

The name of the portlet is URN-portlet.urn and the dot inside the name causes a wrong behavior.

Read the error message:

path /urn/get-url and method GET for //URN-portlet

Change the name of the portlet with a better one.

Upvotes: 1

Related Questions