Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Create portlet with web service (build-wsdd problem) Karel Teniska 12 luglio 2012 8.40
RE: Create portlet with web service (build-wsdd problem) Linus Sphinx 12 luglio 2012 10.35
RE: Create portlet with web service (build-wsdd problem) Jay Patel 12 luglio 2012 10.38
RE: Create portlet with web service (build-wsdd problem) Karel Teniska 12 luglio 2012 13.56
RE: Create portlet with web service (build-wsdd problem) David H Nebinger 12 luglio 2012 20.44
RE: Create portlet with web service (build-wsdd problem) Karel Teniska 12 luglio 2012 23.05
RE: Create portlet with web service (build-wsdd problem) Karel Teniska 13 luglio 2012 3.26
RE: Create portlet with web service (build-wsdd problem) David H Nebinger 13 luglio 2012 6.26
RE: Create portlet with web service (build-wsdd problem) Karel Teniska 13 luglio 2012 7.42
RE: Create portlet with web service (build-wsdd problem) MICHAIL MOUDATSOS 6 settembre 2012 8.06
RE: Create portlet with web service (build-wsdd problem) Pedro Almeida 11 dicembre 2012 5.22
RE: Create portlet with web service (build-wsdd problem) Hari Dobbala 17 dicembre 2012 2.36
RE: Create portlet with web service (build-wsdd problem) MICHAIL MOUDATSOS 17 dicembre 2012 3.36
RE: Create portlet with web service (build-wsdd problem) Hitoshi Ozawa 13 luglio 2012 8.07
RE: Create portlet with web service (build-wsdd problem) Karel Teniska 13 luglio 2012 8.22
RE: Create portlet with web service (build-wsdd problem) Karel Teniska 13 luglio 2012 8.32
RE: Create portlet with web service (build-wsdd problem) Hitoshi Ozawa 13 luglio 2012 8.36
RE: Create portlet with web service (build-wsdd problem) Karel Teniska 13 luglio 2012 8.45
RE: Create portlet with web service (build-wsdd problem) Karel Teniska 13 luglio 2012 8.59
RE: Create portlet with web service (build-wsdd problem) Karel Teniska 14 luglio 2012 2.37
Karel Teniska
Create portlet with web service (build-wsdd problem)
12 luglio 2012 8.40
Risposta

Karel Teniska

Punteggio: Junior Member

Messaggi: 68

Data di Iscrizione: 26 giugno 2012

Messaggi recenti

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)
12 luglio 2012 10.35
Risposta

Linus Sphinx

Punteggio: Junior Member

Messaggi: 84

Data di Iscrizione: 12 agosto 2010

Messaggi recenti

Curious, what number step are you getting to when this happens?
Jay Patel
RE: Create portlet with web service (build-wsdd problem)
12 luglio 2012 10.38
Risposta

Jay Patel

Punteggio: Regular Member

Messaggi: 116

Data di Iscrizione: 23 febbraio 2010

Messaggi recenti

Hi Petr,

Would you please attach your service.xml?

-Jay.
Karel Teniska
RE: Create portlet with web service (build-wsdd problem)
12 luglio 2012 13.56
Risposta

Karel Teniska

Punteggio: Junior Member

Messaggi: 68

Data di Iscrizione: 26 giugno 2012

Messaggi recenti

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)
12 luglio 2012 20.44
Risposta

David H Nebinger

Punteggio: Liferay Legend

Messaggi: 7252

Data di Iscrizione: 1 settembre 2006

Messaggi recenti

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)
12 luglio 2012 23.05
Risposta

Karel Teniska

Punteggio: Junior Member

Messaggi: 68

Data di Iscrizione: 26 giugno 2012

Messaggi recenti

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
Allegati: myportlet.war (1.181,8k)
Karel Teniska
RE: Create portlet with web service (build-wsdd problem)
13 luglio 2012 3.26
Risposta

Karel Teniska

Punteggio: Junior Member

Messaggi: 68

Data di Iscrizione: 26 giugno 2012

Messaggi recenti

More this is my build-wsdd log in atachment...
Allegati: mylog.txt (6,1k)
David H Nebinger
RE: Create portlet with web service (build-wsdd problem)
13 luglio 2012 6.26
Risposta

David H Nebinger

Punteggio: Liferay Legend

Messaggi: 7252

Data di Iscrizione: 1 settembre 2006

Messaggi recenti

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)
13 luglio 2012 7.42
Risposta

Karel Teniska

Punteggio: Junior Member

Messaggi: 68

Data di Iscrizione: 26 giugno 2012

Messaggi recenti

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)
13 luglio 2012 8.07
Risposta

Hitoshi Ozawa

Punteggio: Liferay Legend

Messaggi: 7954

Data di Iscrizione: 23 marzo 2010

Messaggi recenti

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)
13 luglio 2012 8.22
Risposta

Karel Teniska

Punteggio: Junior Member

Messaggi: 68

Data di Iscrizione: 26 giugno 2012

Messaggi recenti

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)
13 luglio 2012 8.32
Risposta

Karel Teniska

Punteggio: Junior Member

Messaggi: 68

Data di Iscrizione: 26 giugno 2012

Messaggi recenti

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)
13 luglio 2012 8.36
Risposta

Hitoshi Ozawa

Punteggio: Liferay Legend

Messaggi: 7954

Data di Iscrizione: 23 marzo 2010

Messaggi recenti

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)
13 luglio 2012 8.45
Risposta

Karel Teniska

Punteggio: Junior Member

Messaggi: 68

Data di Iscrizione: 26 giugno 2012

Messaggi recenti

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)
13 luglio 2012 8.59
Risposta

Karel Teniska

Punteggio: Junior Member

Messaggi: 68

Data di Iscrizione: 26 giugno 2012

Messaggi recenti

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)
14 luglio 2012 2.37
Risposta

Karel Teniska

Punteggio: Junior Member

Messaggi: 68

Data di Iscrizione: 26 giugno 2012

Messaggi recenti

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)
6 settembre 2012 8.06
Risposta

MICHAIL MOUDATSOS

Punteggio: Regular Member

Messaggi: 110

Data di Iscrizione: 4 ottobre 2011

Messaggi recenti

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)
11 dicembre 2012 5.22
Risposta

Pedro Almeida

Punteggio: Junior Member

Messaggi: 41

Data di Iscrizione: 30 luglio 2012

Messaggi recenti

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)
17 dicembre 2012 2.36
Risposta

Hari Dobbala

Punteggio: Junior Member

Messaggi: 29

Data di Iscrizione: 17 novembre 2012

Messaggi recenti

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)
17 dicembre 2012 3.36
Risposta

MICHAIL MOUDATSOS

Punteggio: Regular Member

Messaggi: 110

Data di Iscrizione: 4 ottobre 2011

Messaggi recenti

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...