留言板

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

S Ts,修改在7 年前。

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

New Member 帖子: 16 加入日期: 16-8-31 最近的帖子
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,修改在7 年前。

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

Liferay Legend 帖子: 14914 加入日期: 06-9-2 最近的帖子
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,修改在7 年前。

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

New Member 帖子: 16 加入日期: 16-8-31 最近的帖子
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,修改在7 年前。

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

Liferay Legend 帖子: 14914 加入日期: 06-9-2 最近的帖子
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,修改在7 年前。

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

New Member 帖子: 16 加入日期: 16-8-31 最近的帖子
Should be the latest liferay 7. Looks like I downloaded the bundle on Aug 22
thumbnail
David H Nebinger,修改在7 年前。

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

Liferay Legend 帖子: 14914 加入日期: 06-9-2 最近的帖子
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,修改在7 年前。

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

New Member 帖子: 16 加入日期: 16-8-31 最近的帖子
Adding remote-service="true" doesn't seem to help.
Andrea Maschio,修改在7 年前。

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

New Member 帖子: 14 加入日期: 16-7-27 最近的帖子
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,修改在7 年前。

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

New Member 帖子: 16 加入日期: 16-8-31 最近的帖子
I think this is a known issue.
http://issues.liferay.com/browse/LPS-66607
thumbnail
Juan Gonzalez,修改在7 年前。

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

Liferay Legend 帖子: 3089 加入日期: 08-10-28 最近的帖子
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,修改在7 年前。

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

Junior Member 帖子: 85 加入日期: 16-7-12 最近的帖子
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,修改在7 年前。

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

New Member 帖子: 10 加入日期: 16-9-5 最近的帖子
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.