Foros de discusión

Service Builder remote service not showing up in exposed json web services

S Ts, modificado hace 7 años.

Service Builder remote service not showing up in exposed json web services

New Member Mensajes: 16 Fecha de incorporación: 31/08/16 Mensajes recientes
Hi,

I created a remote service with the service builder using an entity with no columns (just a dummy entity). The build service gradle task completes with no errors and generates the source files correctly. Unfortunately any methods i define in *ServiceImpl.java do not show up in the JSONWS API.

When I add a column to the entity and re-run the service builder the remote services do appear in the JSONWS API.

Is there any reason for this behaviour?

service.xml, No column

<!--?xml version="1.0"?-->

<service-builder package-path="com.example">
	<namespace>fileservice</namespace>
    <entity name="BigLoader" local-service="true" cache-enabled="false">
    </entity>
</service-builder>


added col

<!--?xml version="1.0"?-->

<service-builder package-path="com.example">
	<namespace>fileservice</namespace>
    <entity name="BigLoader" local-service="true" cache-enabled="false">
        <column name="DummyCol" primary="true" type="int"></column>
    </entity>
</service-builder>
thumbnail
David H Nebinger, modificado hace 7 años.

RE: Service Builder remote service not showing up in exposed json web servi

Liferay Legend Mensajes: 14918 Fecha de incorporación: 2/09/06 Mensajes recientes
An entity with no columns has no automatic methods exposed. Once you add the column, that adds default methods and it appears in the json api.

If instead of adding a column to the entity, you went into BigLoaderServiceImpl class and added some method and rebuilt services, you would see methods exposed in the jsonws api panel.






Come meet me at the LSNA!
S Ts, modificado hace 7 años.

RE: Service Builder remote service not showing up in exposed json web servi

New Member Mensajes: 16 Fecha de incorporación: 31/08/16 Mensajes recientes
Hey thanks for the reply,

I should clarify that I did have methods in BigLoaderServiceImpl. These methods did not get exposed via the json api (in fact i could not even see the context path in the drop down at /api/jsonws). When I added a column I could then see the methods I had written.
thumbnail
David H Nebinger, modificado hace 7 años.

RE: Service Builder remote service not showing up in exposed json web servi

Liferay Legend Mensajes: 14918 Fecha de incorporación: 2/09/06 Mensajes recientes
Okay, what version of Liferay are you using?

The column should not be required certainly. The question is whether it is a known bug or something that has been fixed...







Come meet me at the LSNA!
S Ts, modificado hace 7 años.

RE: Service Builder remote service not showing up in exposed json web servi

New Member Mensajes: 16 Fecha de incorporación: 31/08/16 Mensajes recientes
Should be the latest liferay 7. Looks like I downloaded the bundle on Aug 22
thumbnail
David H Nebinger, modificado hace 7 años.

RE: Service Builder remote service not showing up in exposed json web servi

Liferay Legend Mensajes: 14918 Fecha de incorporación: 2/09/06 Mensajes recientes
Okay, so I actually have not tried this under LR7 yet.

Does it impact the outcome if you actually add remote-service="true" to your entity? It shouldn't, but who knows if SB is trying to decide on it's own to expose or not.

Have you searched issues.liferay.com to see if there's a reported issue on this? If there isn't one you might consider reporting.







Come meet me at the LSNA!
S Ts, modificado hace 7 años.

RE: Service Builder remote service not showing up in exposed json web servi

New Member Mensajes: 16 Fecha de incorporación: 31/08/16 Mensajes recientes
Adding remote-service="true" doesn't seem to help.
Andrea Maschio, modificado hace 7 años.

RE: Service Builder remote service not showing up in exposed json web servi

New Member Mensajes: 14 Fecha de incorporación: 27/07/16 Mensajes recientes
David H Nebinger:
Okay, what version of Liferay are you using?

The column should not be required certainly. The question is whether it is a known bug or something that has been fixed...


I'm afraid I stumbled upon the same bug. It's all day I'm trying to understand why my Liferay 7.0.1 Ga2 doesn't expose ANY of my JSON webservices at all. I've tried to rebuild services so many times.. in my case I have an Author entity with three columns (one of which is id) and my AuthorServiceImpl has public methods in it.

I've tried starting from a helloworld, but no method and in fact no contextName gets ever added. I have a project based on the same liferay version which works properly and was trying to understand why.

My service-api osgi module has this method


public interface AuthorService extends BaseService {

	public java.lang.String getOSGiServiceIdentifier();

	@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
	public java.util.List<author> getAuthors(int start, int end);
}
</author>


I suspect I am affected by the same problem, unfortunately I just moved from a liferay 6.1-2 training to 7 so I am no expert.
S Ts, modificado hace 7 años.

RE: Service Builder remote service not showing up in exposed json web servi

New Member Mensajes: 16 Fecha de incorporación: 31/08/16 Mensajes recientes
I think this is a known issue.
http://issues.liferay.com/browse/LPS-66607
thumbnail
Juan Gonzalez, modificado hace 7 años.

RE: Service Builder remote service not showing up in exposed json web servi

Liferay Legend Mensajes: 3089 Fecha de incorporación: 28/10/08 Mensajes recientes
Andrea Maschio:
David H Nebinger:
Okay, what version of Liferay are you using?

The column should not be required certainly. The question is whether it is a known bug or something that has been fixed...


I'm afraid I stumbled upon the same bug. It's all day I'm trying to understand why my Liferay 7.0.1 Ga2 doesn't expose ANY of my JSON webservices at all. I've tried to rebuild services so many times.. in my case I have an Author entity with three columns (one of which is id) and my AuthorServiceImpl has public methods in it.

I've tried starting from a helloworld, but no method and in fact no contextName gets ever added. I have a project based on the same liferay version which works properly and was trying to understand why.

My service-api osgi module has this method


public interface AuthorService extends BaseService {

	public java.lang.String getOSGiServiceIdentifier();

	@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
	public java.util.List<author> getAuthors(int start, int end);
}
</author>


I suspect I am affected by the same problem, unfortunately I just moved from a liferay 6.1-2 training to 7 so I am no expert.


Seems Andrea fixed this issue by following steps here https://web.liferay.com/community/forums/-/message_boards/message/78393499#_19_message_78836905.
thumbnail
Gaurav Jain, modificado hace 7 años.

RE: Service Builder remote service not showing up in exposed json web servi

Junior Member Mensajes: 85 Fecha de incorporación: 12/07/16 Mensajes recientes
Hi S Ts,

S Ts:


I should clarify that I did have methods in BigLoaderServiceImpl. These methods did not get exposed via the json api (in fact i could not even see the context path in the drop down at /api/jsonws). When I added a column I could then see the methods I had written.


To see the context path in the drop down at /api/jsonws you need to build wsdd of your entity. For this you need to add wssdd plugin dependencies in build.gradle files of your service-builder module.

Go through all build.gradle files of this sample project on git hub https://github.com/amusarra/liferay-italia-bo-usergroup/tree/eabde4ed22dd65eae4d66e271adf36cf53003b00/modules/service-builder/horse

This shows what changes you need to do in your all build.gradle files.
Let me know if it helps.

Gaurav
Heiner Kücker, modificado hace 7 años.

RE: Service Builder remote service not showing up in exposed json web servi

New Member Mensajes: 10 Fecha de incorporación: 5/09/16 Mensajes recientes
Building wsdd is only necessary for axis (soap) webservices.

In my case the solution was to change the 'compileOnly' statements to 'compile' in build.gradle file of service sub module (not api sub module) of the servicebuilder sub module of Liferay Workspace Project.

To activate the change select in Eclipse Liferay IDE in Project Explorer any node and click right mouse key and choose Menu item Gradle - Refresh Gradle Project.