xmlrestapiliferayliferay-6.2

Liferay 6.2 rest api with content type text/xml


I am trying to create a POST API for a client so that they can send XML to my server, the problem is in Liferay I am unable to find how to create such API. As per my findings, Liferay only provides implementation/support for JSON and SOAP services.


Solution

  • If your Service API is not directly related with your portlet, you could also host a plain Servlet using PortalDelegateServlet liferay-invoke-servlet-from-portlet.html so that clients can post raw XML to your server, that you can process. Your URL will look like: {HOST}/delegate/{Sub-ContextName}. But you need to take care of authentication/authorization by yourself using principal information.