Liferay Plugin Portal JSON Web Services :- Liferay support the REST API. By Using That we have to create restful web services and the data format of that is JSON.
Liferay internally supports to create JSON services. it already have many portal JSON web services, these are simple URL calls by using web services, we can get the JSON data and use any where to consume web services.
In this tutorial I am guiding you about the Plugin Portal Web Services of Liferay. you can see all portal JSON web service by accessing following URL.
To make a restful web services follow the following steps:-
1. create service.xml in your plugin portlet project.
- <?xml version=”1.0″ encoding=”UTF-8″?>
- <!DOCTYPE service-builder PUBLIC “-//Liferay//DTD Service Builder 6.2.0//EN” “http://www.liferay.com/dtd/liferay-service-builder_6_2&_0.dtd”>
- <service-builder package-path=”com.evon”>
- <entity name=”Student” local-service=”true” remote-service=”true”>
- <!– PK fields –>
- <column name=”studentId” type=”long” primary=”true” />
- <!– Other fields –>
- <column name=”name” type=”String” />
- <column name=”address” type=”String” />
- <!– Order –>
- <order by=”asc”>
- <order-column name=”name” />
In above code we have created an entity Student and taken some fields like studentId, name and address then build your service.xml. We have seen that the all necessary files are automatically generated in your project after successful build of service.xml.
2. We need to write java method according to our requirement. We have to….
Read Full Blog : Using JSON Web Services with Liferay
You can check more informative blogs and tutorials at java development blogs section and can also browse the java developer forum for posting and viewing latest questions on java development.
Apart from this, If you have any Php issue, you can post it at Php Questions and Answers Forum