Posts

Showing posts from August, 2017

Cosuming Liferay JSON Web Services

In liferay you can write json web service  easily. You can also consume those web service from other client such in java httpclient, javascript(like ajax jquery), dukescript and other client . For example you have a portlet name test-portlet and you write a json webservice as below:     @JSONWebService(value = "testService", method = "POST")     public JSONObject testService(String test) throws SystemException {         JSONObject result = JSONFactoryUtil.createJSONObject();         result.put("test", test);         return result;     } For consuming this service from several clients you can follow below steps: 1. In java client Here you can use jersy.  Client code given below:        Client    client = ClientBuilder.newClient();         ...