Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Create portlet with web service (build-wsdd problem) Karel Teniska July 12, 2012 8:40 AM
RE: Create portlet with web service (build-wsdd problem) Linus Sphinx July 12, 2012 10:35 AM
RE: Create portlet with web service (build-wsdd problem) Jay Patel July 12, 2012 10:38 AM
RE: Create portlet with web service (build-wsdd problem) Karel Teniska July 12, 2012 1:56 PM
RE: Create portlet with web service (build-wsdd problem) David H Nebinger July 12, 2012 8:44 PM
RE: Create portlet with web service (build-wsdd problem) Karel Teniska July 12, 2012 11:05 PM
RE: Create portlet with web service (build-wsdd problem) Karel Teniska July 13, 2012 3:26 AM
RE: Create portlet with web service (build-wsdd problem) David H Nebinger July 13, 2012 6:26 AM
RE: Create portlet with web service (build-wsdd problem) Karel Teniska July 13, 2012 7:42 AM
RE: Create portlet with web service (build-wsdd problem) MICHAIL MOUDATSOS September 6, 2012 8:06 AM
RE: Create portlet with web service (build-wsdd problem) Pedro Almeida December 11, 2012 5:22 AM
RE: Create portlet with web service (build-wsdd problem) Hari Dobbala December 17, 2012 2:36 AM
RE: Create portlet with web service (build-wsdd problem) MICHAIL MOUDATSOS December 17, 2012 3:36 AM
RE: Create portlet with web service (build-wsdd problem) Hitoshi Ozawa July 13, 2012 8:07 AM
RE: Create portlet with web service (build-wsdd problem) Karel Teniska July 13, 2012 8:22 AM
RE: Create portlet with web service (build-wsdd problem) Karel Teniska July 13, 2012 8:32 AM
RE: Create portlet with web service (build-wsdd problem) Hitoshi Ozawa July 13, 2012 8:36 AM
RE: Create portlet with web service (build-wsdd problem) Karel Teniska July 13, 2012 8:45 AM
RE: Create portlet with web service (build-wsdd problem) Karel Teniska July 13, 2012 8:59 AM
RE: Create portlet with web service (build-wsdd problem) Karel Teniska July 14, 2012 2:37 AM
Karel Teniska
Create portlet with web service (build-wsdd problem)
July 12, 2012 8:40 AM
Answer

Karel Teniska

Rank: Junior Member

Posts: 68

Join Date: June 26, 2012

Recent Posts

Hi , i tried create portlet vith web service by example:

http://www.liferay.com/community/wiki/-/wiki/Main/Creating+Liferay+6+plugin+web+service

But when i tried run build-wsdd , ant throw this log:

10:00:54,506 WARN [Types:1704] The class cz.ictb.algoportal.main.model.algoOrganization does not contain a default constructor, which is a requirement for a bean class. The class cannot be converted into an xml schema type. An xml schema anyType will be used to define this class in the wsdl file.

I think that problem is on line with message"The class cz.ictb.algoportal.main.model.algoOrganization does not contain a default constructor" , but i dont wkno how solve this?


Please help ...

Thnak you
Linus Sphinx
RE: Create portlet with web service (build-wsdd problem)
July 12, 2012 10:35 AM
Answer

Linus Sphinx

Rank: Junior Member

Posts: 84

Join Date: August 12, 2010

Recent Posts

Curious, what number step are you getting to when this happens?
Jay Patel
RE: Create portlet with web service (build-wsdd problem)
July 12, 2012 10:38 AM
Answer

Jay Patel

Rank: Regular Member

Posts: 116

Join Date: February 23, 2010

Recent Posts

Hi Petr,

Would you please attach your service.xml?

-Jay.
Karel Teniska
RE: Create portlet with web service (build-wsdd problem)
July 12, 2012 1:56 PM
Answer

Karel Teniska

Rank: Junior Member

Posts: 68

Join Date: June 26, 2012

Recent Posts

Thank you very much for yours posts guys. I am desperate.

In tutorial "http://www.liferay.com/community/wiki/-/wiki/Main/Creating+Liferay+6+plugin+web+service" number of step is 22.

An this is my service.xml

 1
 2<?xml version="1.0" encoding="UTF-8"?>
 3<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.0.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_0_0.dtd">
 4<service-builder package-path="com.liferay.test">
 5    <author>kapil</author>
 6    <namespace>Test</namespace>
 7
 8    <entity name="Employee" local-service="true" remote-service="true">
 9        <column name="id" type="long" primary="true"/>
10        <column name="name" type="String"/>
11       
12        <finder name="Name" return-type="Collection">
13            <finder-column name="name"/>
14        </finder>
15    </entity>
16</service-builder>


i will very grateful for any idea.

Thak you guys
David H Nebinger
RE: Create portlet with web service (build-wsdd problem)
July 12, 2012 8:44 PM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7027

Join Date: September 1, 2006

Recent Posts

This doesn't contain any reference to the algoOrganization thing mentioned from your first post, nor does the package path match the one from the service.xml.

Either you've posted the wrong service.xml file, or you have other code mixed in that you haven't accounted for (and is probably the source of the error).
Karel Teniska
RE: Create portlet with web service (build-wsdd problem)
July 12, 2012 11:05 PM
Answer

Karel Teniska

Rank: Junior Member

Posts: 68

Join Date: June 26, 2012

Recent Posts

I am so sorry mr. Nebinger ,, i tried everithing. First i tried create my structure and next i tried create portelt exactly step by step by tuturial, but warn message during build-wsdd Ant opration is same. (only error during posting):

he class com.liferay.test.model.Employee does not contain a default constructor

Some days i crashed on this problem emoticon

I give attachment my portlet, anyone please help.

Petr

PS: Mr. Nebinger i read "Liferay in Action" and "Portlet in Action" but according them my way is coorect. emoticon
Attachments: myportlet.war (1,181.8k)
Karel Teniska
RE: Create portlet with web service (build-wsdd problem)
July 13, 2012 3:26 AM
Answer

Karel Teniska

Rank: Junior Member

Posts: 68

Join Date: June 26, 2012

Recent Posts

More this is my build-wsdd log in atachment...
Attachments: mylog.txt (6.1k)
David H Nebinger
RE: Create portlet with web service (build-wsdd problem)
July 13, 2012 6:26 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7027

Join Date: September 1, 2006

Recent Posts

Your EmployeeLocalServiceImpl is definitely messed up... Your EmployeeLocalServiceImpl should not be calling EmployeeUtil directly. All of the methods that you need to access are either inherited or available in the employeePersistence member variable.

Basically you've got two sets of classes when using Service Builder. You have the service classes, compiled and put into the service jar, which represent the API for your service.

Then you have the implementation classes. These classes implement the service details, and have full visibility to the internals of the implementation.

Inside of the implementation classes, you should not be reaching out to the service layer when the implementation is visible.

For example, your create() method in EmployeeLocalServiceImpl looks like this:

 1    public Employee create(Employee model) throws SystemException{
 2        long id = CounterLocalServiceUtil.increment(Employee.class.getName());
 3        model.setId(id);
 4        Employee newModel = EmployeeUtil.create(model.getId());
 5
 6        newModel.setName(model.getName());
 7        EmployeeUtil.update(newModel, true);
 8        return newModel;
 9    }


This is totally the wrong way to have done it, as EmployeeUtil is in the service jar and there's no reason to go that route.

Instead, your create method should be:

 1public Employee create(Employee model) throws SystemException {
 2    long id = CounterLocalServiceUtil.increment(Employee.class.getName());
 3
 4    Employee newModel = createEmployee(id);
 5
 6    newModel.setName(model.getName());
 7
 8    return update(newModel, true);
 9}


Since the EmployeeLocalServiceImpl class has visibility on existing methods and the employeePersistence member variable, there is no reason to go through EmployeeUtil.

Finally, it is sometimes a good idea to invoke the 'clean' task when you're making changes to the service.xml or the implementation classes. It ensures that any old cruft is removed from the build...
Karel Teniska
RE: Create portlet with web service (build-wsdd problem)
July 13, 2012 7:42 AM
Answer

Karel Teniska

Rank: Junior Member

Posts: 68

Join Date: June 26, 2012

Recent Posts

Thank you very much Mr. Nebinger, immediately i will try. And can i question. Does it exist some class diagram or description how work service structure?

Thank you again.
Hitoshi Ozawa
RE: Create portlet with web service (build-wsdd problem)
July 13, 2012 8:07 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

If you're interested, I've attached a sample web service prograim on the following page.
http://www.liferay.com/community/wiki/-/wiki/Main/Web+Service+samples
Karel Teniska
RE: Create portlet with web service (build-wsdd problem)
July 13, 2012 8:22 AM
Answer

Karel Teniska

Rank: Junior Member

Posts: 68

Join Date: June 26, 2012

Recent Posts

Hello Mr. Ozawa,
Really? its will be amazing!
¨this attachment? -> liferay-wstools_6.1.0GA1_20120523.zip
Karel Teniska
RE: Create portlet with web service (build-wsdd problem)
July 13, 2012 8:32 AM
Answer

Karel Teniska

Rank: Junior Member

Posts: 68

Join Date: June 26, 2012

Recent Posts

I am so sorry i dont understend it. Do you have some WAR with source for Liferay deploy? I am novice and I lose a little emoticon but my boss want result emoticon
Hitoshi Ozawa
RE: Create portlet with web service (build-wsdd problem)
July 13, 2012 8:36 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

Sorry, it's just a java program and not a portlet. Source code is included which you may look at.

If you can't provide results to your boss, may be he should be hiring me instead. :-)
Karel Teniska
RE: Create portlet with web service (build-wsdd problem)
July 13, 2012 8:45 AM
Answer

Karel Teniska

Rank: Junior Member

Posts: 68

Join Date: June 26, 2012

Recent Posts

emoticon my first smile today ... emoticon , ok i will be fight.
Thank you very much
Karel Teniska
RE: Create portlet with web service (build-wsdd problem)
July 13, 2012 8:59 AM
Answer

Karel Teniska

Rank: Junior Member

Posts: 68

Join Date: June 26, 2012

Recent Posts

Or please , little council on end.

What i need:

I need crate web service (SOAP) through which i call my libs in Lifeeray maybe liferey services to. ? do i go right way? Or i have to use another solution?

Thank you
Karel Teniska
RE: Create portlet with web service (build-wsdd problem)
July 14, 2012 2:37 AM
Answer

Karel Teniska

Rank: Junior Member

Posts: 68

Join Date: June 26, 2012

Recent Posts

Just i want heartily thank two. Now my services works and everithing looks ok.

As Mr. Nebinger said the implementation of my XXXLocalServicesImp was that problem. Finally i understand how it works. Once more time i would like to thank you.

For other people who has the same problem, tutorial on page "http://www.liferay.com/community/wiki/-/wiki/Main/Creating+Liferay+6+plugin+web+service" is with mistakes. On last version of service builder isnt necesarry to correct implementation of XXXServiceSoap and methods in XXXLocalServicesImp are all wrong...
MICHAIL MOUDATSOS
RE: Create portlet with web service (build-wsdd problem)
September 6, 2012 8:06 AM
Answer

MICHAIL MOUDATSOS

Rank: Regular Member

Posts: 110

Join Date: October 4, 2011

Recent Posts

David H Nebinger:
Inside of the implementation classes, you should not be reaching out to the service layer when the implementation is visible.
...
Since the EmployeeLocalServiceImpl class has visibility on existing methods and the employeePersistence member variable, there is no reason to go through EmployeeUtil.

Does the above hold for the EntityServiceImpl class, as well? From your answer I can only assume that in such a class it is advisable to use the EntityLocalServiceUtil methods versus the EntityUtil methods. Is this assumption correct?

Of course, some of the EntityLocalServiceUtil methods may have been, in turn, implemented in EntityLocalServiceImpl

thank you in advance

EDIT:
Note that in 6.0.6 plugins sdk the error stated by the thread creator, i.e., 14:44:58,325 WARN [Types:1704] The class mypackagae.path.model.Entity does not contain a default constructor, which is a requirement for a bean class. The class cannot be converted into an xml schema type. An xml schema anyType will be used to define this class in the wsdl file. is thrown at build-wsdd, even when you have two empty methods that use Entity either as a method parameter or as a return value type. So, even though the answers given are correct, they re not the right answer to the primary question about the error message.

I still had to do the correction mentioned in this wiki or as an alternative that allows me to rebuild services freely without re-correcting the generated Soap class, I explicitly made my EntityServiceUtil functions to take and return respectively an EntitySoap object rather than an Entity object. This is quick n' dirty and helps only if these methods are destined to be used as web services and only as such, otherwise it's an ugly solution - I know

example:
1public EntitySoap update(EntitySoap entity) throws NoSuchEntityException, SystemException
2{
3    return EntitySoap.toSoapModel(EntityLocalServiceUtil.updateEntity(EntityModelImpl.toModel(entity), true));
4}
Pedro Almeida
RE: Create portlet with web service (build-wsdd problem)
December 11, 2012 5:22 AM
Answer

Pedro Almeida

Rank: Junior Member

Posts: 41

Join Date: July 30, 2012

Recent Posts

I have been trying to accomplish this as well without sucess. Never does the service show up when I do http://127.0.0.1:8080/api/axis, and I have followed the guide linked from here and the proposed corrections.

Does anyone know if there is an updated, corrected how-to? For 6.1.

Thanks.
Hari Dobbala
RE: Create portlet with web service (build-wsdd problem)
December 17, 2012 2:36 AM
Answer

Hari Dobbala

Rank: Junior Member

Posts: 29

Join Date: November 17, 2012

Recent Posts

Hi all,

I am also facing the same problem while building wsdd on liferay 6.1 by following this link to create the wsdd. Below is the exception I am getting while building wsdd.

10:29:32,606 WARN [Types:1704] The class com.liferay.test.model.Employee does not contain a default constructor, which is a requirement for a bean class. The class cannot be converted into an xml schema type. An xml schema anyType will be used to define this class in the wsdl file.
WSDL2Java D:\dlife\tools\liferay-plugins-sdk-6.1.0-ce-ga1-20120106155615760\portlets\TestPlugin\20121217102932150\service.wsdl
Running Wsdl2javaAntTask with parameters:
verbose:false
debug:false
quiet:false
server-side:true
skeletonDjava.io.IOException: Type {http://model.test.liferay.com}Employee is referenced but not defined.
at org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(SymbolTable.java:665)
at org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:545)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:518)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
at java.lang.Thread.run(Unknown Source)
Exception in thread "main" WSDL processing error for D:\dlife\tools\liferay-plugins-sdk-6.1.0-ce-ga1-20120106155615760\portlets\TestPlugin\20121217102932150\service.wsdl :
Type {http://model.test.liferay.com}Employee is referenced but not defined.
at org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask.execute(Wsdl2javaAntTask.java:304)
at com.liferay.util.ant.Java2WsddTask.generateWsdd(Java2WsddTask.java:108)
at com.liferay.portal.tools.WSDDBuilder._createServiceWSDD(WSDDBuilder.java:130)
at com.liferay.portal.tools.WSDDBuilder.build(WSDDBuilder.java:93)
at com.liferay.portal.tools.WSDDBuilder.main(WSDDBuilder.java:49)
Caused by: java.io.IOException: Type {http://model.test.liferay.com}Employee is referenced but not defined.
at org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(SymbolTable.java:665)
at org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:545)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:518)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
at java.lang.Thread.run(Unknown Source)
eploy:false
----
----

Can any one please tell me how to resolve this problem.

Thanks in advance.
MICHAIL MOUDATSOS
RE: Create portlet with web service (build-wsdd problem)
December 17, 2012 3:36 AM
Answer

MICHAIL MOUDATSOS

Rank: Regular Member

Posts: 110

Join Date: October 4, 2011

Recent Posts

Did you guys carefully read my answer?
MICHAIL MOUDATSOS:
or as an alternative that allows me to rebuild services freely without re-correcting the generated Soap class, I explicitly made my EntityServiceUtil functions to take and return respectively an EntitySoap object rather than an Entity object. This is quick n' dirty and helps only if these methods are destined to be used as web services and only as such, otherwise it's an ugly solution - I know

example:
1public EntitySoap update(EntitySoap entity) throws NoSuchEntityException, SystemException
2{
3    return EntitySoap.toSoapModel(EntityLocalServiceUtil.updateEntity(EntityModelImpl.toModel(entity), true));
4}
I know it concerns 6.0.6 but I can only assume this works for 6.1 as well...