Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Daniel Valverde
Create a service and publish on tunnel WEB
August 5, 2013 12:49 AM
Answer

Daniel Valverde

Rank: New Member

Posts: 13

Join Date: July 8, 2013

Recent Posts

Hi,

I need to develop a service, I know that I can develop a service with service builder, but the service builder you need to define a entity and the service generate this table on the data base and I don need it, I only need a Service where I can publish same functionalities.

Thanks, and I am sorry that my English is not so fine.
Sampsa Sohlman
RE: Create a service and publish on tunnel WEB
August 5, 2013 1:26 AM
Answer

Sampsa Sohlman

LIFERAY STAFF

Rank: Regular Member

Posts: 226

Join Date: September 27, 2007

Recent Posts

Hi Daniel.

Plugin's Remote services are not exposed through Tunnel Web. Only core's services are.

Just make sure that remote-service="true" at service.xml

1<entity name="Foo" ..  remote-service="true" >


And generate services

1ant build-service


and

1ant build-wsdd


Generate client to you remote services (liferay has to be running at 8080 port, with plugin deployed)

1ant build-client


Hope this was helpful,

Sampsa
Daniel Valverde
RE: Create a service and publish on tunnel WEB
August 5, 2013 1:33 AM
Answer

Daniel Valverde

Rank: New Member

Posts: 13

Join Date: July 8, 2013

Recent Posts

Thanks I know that I can so generate a service accesible by SOAP, But in this manner the service builder generate a table in the data base and only I need to generate a service without generationt of tables.

Thanks again
David Ilechukwu
RE: Create a service and publish on tunnel WEB
August 5, 2013 2:53 AM
Answer

David Ilechukwu

Rank: Regular Member

Posts: 128

Join Date: June 7, 2010

Recent Posts

Hi Daniel -
ServiceBuillder is actually quite configurable & there are many ways to generate a service without generating tables or even the entity itself.
Try adding this to your service.xml (then run servicebuilder):

Assuming you want to produce a Service called CustomService with access to Contact Persistence -
 1
 2    <entity name="Custom" local-service="true" remote-service="true">
 3        <!-- PK fields -->
 4        <!-- FK fields -->
 5        <!-- Attribute fields -->
 6        <!-- Audit fields -->
 7
 8        <!-- Reference packages -->
 9        <reference package-path="com.liferay.portal" entity="Contact" />
10    </entity>

I have used this approach many times & it always works. Should solve your problem.

Let me know if it does.
Daniel Valverde
RE: Create a service and publish on tunnel WEB
August 5, 2013 3:35 AM
Answer

Daniel Valverde

Rank: New Member

Posts: 13

Join Date: July 8, 2013

Recent Posts

Thanks David it work fine, now for the SOAP, in the nameclassSoap i must define the different static method and run the build-wsdl task, It is right???

Thanks again emoticon
David Ilechukwu
RE: Create a service and publish on tunnel WEB
August 5, 2013 4:00 AM
Answer

David Ilechukwu

Rank: Regular Member

Posts: 128

Join Date: June 7, 2010

Recent Posts

Great! Good to know it worked for you.
You do not need to modify the Soap files directly. All you need is to add your method definitions to the generated *ServiceImpl files and run build-wsdl.
The soap files will be auto generated.
Your new service should be available for remote use after you run ant build and ant deploy!

Keep me updated on your progress
Sampsa Sohlman
RE: Create a service and publish on tunnel WEB
August 5, 2013 6:32 AM
Answer

Sampsa Sohlman

LIFERAY STAFF

Rank: Regular Member

Posts: 226

Join Date: September 27, 2007

Recent Posts

If you generate service without fields it does not generate DB table.

Example:

1<entity name="Helper" local-service="false" remote-service="true" />


This applies both remote and local services.
David H Nebinger
RE: Create a service and publish on tunnel WEB
August 5, 2013 6:38 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11788

Join Date: September 1, 2006

Recent Posts

Daniel Valverde:
I need to develop a service, I know that I can develop a service with service builder, but the service builder you need to define a entity and the service generate this table on the data base and I don need it, I only need a Service where I can publish same functionalities.


To serve up your own data in the remote web service, you could pursue the fake entity approach.

The idea here is to define an entity which is not backed by the database. The fake entities actually are extremely useful both for local and remote usage and take SB one step closer to being a regular service builder instead of just a database service builder...
David Ilechukwu
RE: Create a service and publish on tunnel WEB
August 13, 2013 2:06 AM
Answer

David Ilechukwu

Rank: Regular Member

Posts: 128

Join Date: June 7, 2010

Recent Posts

Daniel,
So how's it going?

Please let me know if you have any other concerns.
Daniel Valverde
RE: Create a service and publish on tunnel WEB
August 25, 2013 11:19 PM
Answer

Daniel Valverde

Rank: New Member

Posts: 13

Join Date: July 8, 2013

Recent Posts

Sorry, I was the last days on Holydays, and David the services run fine thank for your help.

Best regards.
Daniel Valverde
RE: Create a service and publish on tunnel WEB
September 13, 2013 4:16 AM
Answer

Daniel Valverde

Rank: New Member

Posts: 13

Join Date: July 8, 2013

Recent Posts

Hi, David a have a little problem with the service, i had creted then with Maven without doing any additional coding I try to package and deploy what was produced.. Packages then copies to my liferay deploy dir and I see this output in the logs



117:45:44,340 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][AutoDeployDir:177] Processing simplePortletTest-1.0-SNAPSHOT.war

217:45:44,343 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][PortletAutoDeployListener:77] Copying portlets for /home/chris/git/liferay/bundles/liferay6.1/deploy/simplePortletTest-1.0-SNAPSHOT.war

317:45:44,345 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][BaseDeployer:763] Deploying simplePortletTest-1.0-SNAPSHOT.war

417:45:44,666 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][BaseDeployer:2083] Modifying Servlet 2.4 /home/chris/git/liferay/bundles/liferay6.1/tomcat-7.0.27/temp/20121118174544375/WEB-INF/web.xml

517:45:44,713 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][PortletAutoDeployListener:87] Portlets for /home/chris/git/liferay/bundles/liferay6.1/deploy/simplePortletTest-1.0-SNAPSHOT.war copied successfully. Deployment will start in a few seconds.

617:45:54,576 INFO [pool-2-thread-2][HotDeployImpl:178] Deploying simplePortletTest-1.0-SNAPSHOT from queue

717:45:54,576 INFO [pool-2-thread-2][PluginPackageUtil:1033] Reading plugin package for simplePortletTest-1.0-SNAPSHOT

817:45:54,577 WARN [pool-2-thread-2][PluginPackageUtil:1131] Plugin package on context simplePortletTest-1.0-SNAPSHOT cannot be tracked because this WAR does not contain a liferay-plugin-package.xml file

917:53:57,444 INFO [pool-2-thread-3][PluginPackageUtil:1033] Reading plugin package for simplePortletTest-1.0-SNAPSHOT

1017:53:57,445 WARN [pool-2-thread-3][PluginPackageUtil:1131] Plugin package on context simplePortletTest-1.0-SNAPSHOT cannot be tracked because this WAR does not contain a liferay-plugin-package.xml file





It looks like other articles online that use maven to create portlets don't have the liferay-plugin-package.xml, I DO have the liferay-plugin-package.properties file. Will this be generated when I write actual portlet code (instead of just deploying the auto-generated code)? Or something that's missing from the liferay-portlet-archetype? Is there some example code someone can post of a valid liferay-plugin-package.xml?
David H Nebinger
RE: Create a service and publish on tunnel WEB
September 16, 2013 5:20 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11788

Join Date: September 1, 2006

Recent Posts

Check to ensure you're using the latest maven artifacts (as I understand it there are bugs resolved in the later versions).
Daniel Valverde
RE: Create a service and publish on tunnel WEB
September 16, 2013 8:46 AM
Answer

Daniel Valverde

Rank: New Member

Posts: 13

Join Date: July 8, 2013

Recent Posts

We are using the lastest liferay maven archetype liferay-portal-maven-6.1.20-ee-ga2

Thank you
David Ilechukwu
RE: Create a service and publish on tunnel WEB
September 23, 2013 3:00 AM
Answer

David Ilechukwu

Rank: Regular Member

Posts: 128

Join Date: June 7, 2010

Recent Posts

Hi Daniel -
Sorry had been very busy for a while.
This should be easy to resolve.
Please post for us here the maven tasks which you ran (in the order you ran them).

Also please post the platform of everything you are using (Liferay version and maven version).

We'll take it from there.