Extracting Articles from Liferay Portal

Our goal is to get some of the content from Liferay Portal through SOAP services using Java. We are successfully uploading articles right now JournalArticleServiceSoap. The problem is that this method requires a Group ID and a Post ID and we want to get all articles from a specific group. Hence, we try to get the ids first using the AssetEntryServiceSoap, but that fails.

AssetEntryServiceSoapServiceLocator aesssLocator = new AssetEntryServiceSoapServiceLocator();
    com.liferay.client.soap.portlet.asset.service.http.AssetEntryServiceSoap assetEntryServiceSoap = null;

    URL url = null;
    try {
        url = new URL(
    } catch (MalformedURLException e) {

    try {
        assetEntryServiceSoap = aesssLocator
    } catch (ServiceException e) {
    if (assetEntryServiceSoap == null) {

    Portlet_Asset_AssetEntryServiceSoapBindingStub assetEntryServiceSoapBindingStub = (Portlet_Asset_AssetEntryServiceSoapBindingStub) assetEntryServiceSoap;

    AssetEntrySoap[] entries;
    AssetEntryQuery query = new AssetEntryQuery();

    try {
        int count = assetEntryServiceSoap.getEntriesCount(query);
        System.out.println("Entries count: " + Integer.toString(count));
        entries = assetEntryServiceSoap.getEntries(query);
        if (entries != null) {
        for (AssetEntrySoap aes : assetEntryServiceSoap.getEntries(query)) {
    } catch (RemoteException e1) {


Although getEntriesCount () returns a positive value such as 83, getEnries () always returns an empty array. I am very new to Liferay portal, but it looks strange to me.

By the way, we are obviously not looking for performance here, the key is just to remotely fetch certain content from the portal. If you know of any working solution, your help would be much appreciated.


source to share

1 answer

Usually the AssetEntryQuery will have a little more information in it, for example:

AssetEntryQuery assetEntryQuery = new AssetEntryQuery();
assetEntryQuery.setClassNameIds(new long[] { ClassNameLocalServiceUtil.getClassNameId("com.liferay.portlet.journal.model.JournalArticle") });
assetEntryQuery.setGroupIds(new long[] { groupId });


So this will return all AssetEntries for the groupId you specified, which are also JournalArticles.

Try this and see though, as you say, the Count method returns a positive number, so it might not have any effect, but let it go! :)



All Articles