掲示板

Webservice with Plugins sdk

13年前 に Venkat S によって更新されました。

Webservice with Plugins sdk

Junior Member 投稿: 26 参加年月日: 09/10/27 最新の投稿
Hi,

I have a requirement where one of the method in my portlet class has to serve as a webservice, in this class i am not accessing any database or tables, instead i have a logic to work on with liferay cache. So can anyone help on how can i create a webservice which satisfies above requirement.

I need to use plugins sdk, dont have tables to access, still should i use service builder. If so what can i give as value for entity name in service xml, as i dont have any table to map with.

Thanks,
Venkat.S
thumbnail
13年前 に Thiago Leão Moreira によって更新されました。

RE: Webservice with Plugins sdk

Liferay Legend 投稿: 1449 参加年月日: 07/10/10 最新の投稿
This should be enough:

<service-builder package-path="com.liferay.foo">
	<namespace>Bar</namespace>
    <entity name="Bar" local-service="true" remote-service="true">
    </entity>
</service-builder>
13年前 に Venkat S によって更新されました。

RE: Webservice with Plugins sdk

Junior Member 投稿: 26 参加年月日: 09/10/27 最新の投稿
Hi,
Thanks for your response.

I created a empty plugin portlet project, created a service, added the entity as mentioned, and ran the deploy task. When i hit the url , i get the following error.

Fault - ; nested exception is:
org.apache.axis.ConfigurationException: java.lang.ClassCastException: org.apache.axis.handlers.http.URLMapper cannot be cast to org.apache.axis.Handler
java.lang.ClassCastException: org.apache.axis.handlers.http.URLMapper cannot be cast to org.apache.axis.Handler
at org.apache.axis.deployment.wsdd.WSDDDeployableItem.makeNewInstance(WSDDDeployableItem.java:302)



Can you please let me know, if am going wrong somewhere.

Thanks,
Venkat
12年前 に Martin S. によって更新されました。

RE: Webservice with Plugins sdk

New Member 投稿: 7 参加年月日: 11/03/08 最新の投稿
Hi,

I also have the same error. I tried to remove axis.jar from my Plugin WAR but the then partly NoClassDefFoundError occurs. Moving axis.jar to common classloader doesn't help too.

Any news or hints concernung this problem? I found several contributions in Liferay forum but no solution.

Best regards
Martin
thumbnail
12年前 に amit doshi によって更新されました。

RE: Webservice with Plugins sdk

Liferay Master 投稿: 550 参加年月日: 10/12/29 最新の投稿
Hi,

I have the same requirement, I want to write some logic on the method and want to expose that as a webservice and also the same on the tunnel-web.

So, I created simple service with two field which i don't require but still I kept the colum name, it by passes the error and works fine for me.

<!--?xml version="1.0" encoding="UTF-8"?-->

<service-builder package-path="com.hersheys.idp">
	<author>amit.doshi</author>
	<namespace>Demo</namespace>

	<entity name="Demo" local-service="true" remote-service="true">



		<column name="id" type="long" primary="true" />
		<column name="name" type="String" />
		

	
	
	</entity>
</service-builder>



The above service.xml created the class of Demo and all necessary classes and written the method inside it and once again build the service and it works fine for me ..

Let me know by adding column field helps to solve the error.

Thanks & Regards,
Amit Doshi