You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Samuel Quintana <so...@gmail.com> on 2013/04/16 02:31:59 UTC
Repeated classes in java2WS
Hi all:
I hope that can help me. I need create the WSDL file and then create a
clien with ant task, but when i run the task the generated namespaces of my
DTOs aren't respected, for example, original the namespace is *com.oz.dto* for
all dto's pojos and *com.oz.ws.definitions* for SEI Interfaces:
- *com.oz.ws.sei.register*
- RegisterSEI
- *com.oz.dto
*
- UserDto
- PersonDto
- AddressDto
but the generated client code create only one package(*
com.oz.ws.sei.register*), in this package all classes are put, like this.
- *com.oz.ws.sei.register*
- RegisterSEI
- *UserDto*
- *PersonDto*
- *AddressDto*
In the parameter SEI method i define:
@WebMethod
Integer register(
@WebParam(name = "companyId") Integer companyId,
*@WebParam(name = "user", targetNamespace = "http://ws.oz.com/dto") UserDto
user*
);
but this generate the following:
- *com.oz.ws.definitions*
- RegisterSEI
- *UserDto*
- *PersonDto*
- *AddressDto*
- *com.oz.dto
*
- *ObjectFactory*
The main problem is when i define a new SEI that share dto's with another
SEI. The generated code result is as follow:
- com.oz.ws.sei.*register*
- RegisterSEI
- *UserDto*
- *PersonDto*
- *AddressDto*
- com.oz.ws.sei.*recovery*
- RecoverySEI
- *UserDto*
- *PersonDto*
- *AddressDto*
As you can see, the dto's are repeated for each package when they are
invoked, how can say to generator that respect my packages?
Thanks a lot for your time.
RE: Repeated classes in java2WS
Posted by Andrei Shakirin <as...@talend.com>.
Hi,
I expect it working out of the box without any workarounds.
Any chance to distil the problem into simple test case and create Jira with attached code?
Regards,
Andrei.
From: Samuel Quintana [mailto:sock.sqt@gmail.com]
Sent: Donnerstag, 18. April 2013 18:49
To: Andrei Shakirin
Cc: users@cxf.apache.org
Subject: Re: Repeated classes in java2WS
Hi Andrei, thank you so much.
It works fine.
But, exist another way to do it? Because i want to define DTOs into a core(Interfaces definitions, dto's) maven module and the implementation(can be database acces, excel file acces, csv access, etc) and publication(with WebServices) in a second and third maven module respectively, so the core module must be independent from any annotation or API.
It can be posibble?
Regards.
2013/4/18 Andrei Shakirin <as...@talend.com>>
Hi,
Does your ant task the following: java SEI -> WSDL -> java client. Is it correct?
Did you try to use @XmlType(name = "Group", namespace = "http://groups.vo.common.acme.com/") annotation in you DTOs?
Regards,
Andrei.
> -----Original Message-----
> From: Samuel Quintana [mailto:sock.sqt@gmail.com<ma...@gmail.com>]
> Sent: Mittwoch, 17. April 2013 19:14
> To: Bharath Ganesh
> Cc: users@cxf.apache.org<ma...@cxf.apache.org>
> Subject: Re: Repeated classes in java2WS
>
> anyone can helpme please?
>
> Thanks a lot.
>
>
> 2013/4/15 Samuel Quintana <so...@gmail.com>>
>
> > Hi all:
> >
> > I hope that can help me. I need create the WSDL file and then create a
> > clien with ant task, but when i run the task the generated namespaces
> > of my DTOs aren't respected, for example, original the namespace is
> > *com.oz.dto* for all dto's pojos and *com.oz.ws.sei.register* for SEI
> Interface:
> >
> > - *com.oz.ws.sei.register*
> > - RegisterSEI
> > - *com.oz.dto
> > *
> > - UserDto
> > - PersonDto
> > - AddressDto
> >
> > but the generated client code create only one package(*
> > com.oz.ws.sei.register*), in this package all classes are put, like this.
> >
> > - *com.oz.ws.sei.register*
> > - RegisterSEI
> > - *UserDto*
> > - *PersonDto*
> > - *AddressDto*
> >
> > In the parameter SEI method i define:
> >
> > @WebMethod
> > Integer register(
> >
> > @WebParam(name = "companyId") Integer companyId,
> >
> > *@WebParam(name = "user", targetNamespace =
> "http://ws.oz.com/dto")
> > UserDto user*
> >
> > );
> >
> > but this generate the following:
> >
> > - *com.oz.ws.definitions*
> > - RegisterSEI
> > - *UserDto*
> > - *PersonDto*
> > - *AddressDto*
> > - *com.oz.dto
> > *
> > - *ObjectFactory*
> >
> > The main problem is when i define a new SEI that share dto's with
> > another SEI. The generated code result is as follow:
> >
> > - com.oz.ws.sei.*register*
> > - RegisterSEI
> > - *UserDto*
> > - *PersonDto*
> > - *AddressDto*
> > - com.oz.ws.sei.*recovery*
> > - RecoverySEI
> > - *UserDto*
> > - *PersonDto*
> > - *AddressDto*
> >
> > As you can see, the dto's are repeated for each package when they are
> > invoked, how can say to generator that respect my packages?
> >
> > Thanks a lot for your time.
> >
Re: Repeated classes in java2WS
Posted by Samuel Quintana <so...@gmail.com>.
Hi Andrei, thank you so much.
It works fine.
But, exist another way to do it? Because i want to define DTOs into a
core(*Interfaces
definitions, dto's*) maven module and the implementation(*can be database
acces, excel file acces, csv access, etc*) and publication(*with WebServices
*) in a second and third maven module respectively, so the core module must
be independent from any annotation or API.
It can be posibble?
Regards.
2013/4/18 Andrei Shakirin <as...@talend.com>
> Hi,
>
> Does your ant task the following: java SEI -> WSDL -> java client. Is it
> correct?
>
> Did you try to use @XmlType(name = "Group", namespace = "
> http://groups.vo.common.acme.com/") annotation in you DTOs?
>
> Regards,
> Andrei.
>
> > -----Original Message-----
> > From: Samuel Quintana [mailto:sock.sqt@gmail.com]
> > Sent: Mittwoch, 17. April 2013 19:14
> > To: Bharath Ganesh
> > Cc: users@cxf.apache.org
> > Subject: Re: Repeated classes in java2WS
> >
> > anyone can helpme please?
> >
> > Thanks a lot.
> >
> >
> > 2013/4/15 Samuel Quintana <so...@gmail.com>
> >
> > > Hi all:
> > >
> > > I hope that can help me. I need create the WSDL file and then create a
> > > clien with ant task, but when i run the task the generated namespaces
> > > of my DTOs aren't respected, for example, original the namespace is
> > > *com.oz.dto* for all dto's pojos and *com.oz.ws.sei.register* for SEI
> > Interface:
> > >
> > > - *com.oz.ws.sei.register*
> > > - RegisterSEI
> > > - *com.oz.dto
> > > *
> > > - UserDto
> > > - PersonDto
> > > - AddressDto
> > >
> > > but the generated client code create only one package(*
> > > com.oz.ws.sei.register*), in this package all classes are put, like
> this.
> > >
> > > - *com.oz.ws.sei.register*
> > > - RegisterSEI
> > > - *UserDto*
> > > - *PersonDto*
> > > - *AddressDto*
> > >
> > > In the parameter SEI method i define:
> > >
> > > @WebMethod
> > > Integer register(
> > >
> > > @WebParam(name = "companyId") Integer companyId,
> > >
> > > *@WebParam(name = "user", targetNamespace =
> > "http://ws.oz.com/dto")
> > > UserDto user*
> > >
> > > );
> > >
> > > but this generate the following:
> > >
> > > - *com.oz.ws.definitions*
> > > - RegisterSEI
> > > - *UserDto*
> > > - *PersonDto*
> > > - *AddressDto*
> > > - *com.oz.dto
> > > *
> > > - *ObjectFactory*
> > >
> > > The main problem is when i define a new SEI that share dto's with
> > > another SEI. The generated code result is as follow:
> > >
> > > - com.oz.ws.sei.*register*
> > > - RegisterSEI
> > > - *UserDto*
> > > - *PersonDto*
> > > - *AddressDto*
> > > - com.oz.ws.sei.*recovery*
> > > - RecoverySEI
> > > - *UserDto*
> > > - *PersonDto*
> > > - *AddressDto*
> > >
> > > As you can see, the dto's are repeated for each package when they are
> > > invoked, how can say to generator that respect my packages?
> > >
> > > Thanks a lot for your time.
> > >
>
RE: Repeated classes in java2WS
Posted by Andrei Shakirin <as...@talend.com>.
Hi,
Does your ant task the following: java SEI -> WSDL -> java client. Is it correct?
Did you try to use @XmlType(name = "Group", namespace = "http://groups.vo.common.acme.com/") annotation in you DTOs?
Regards,
Andrei.
> -----Original Message-----
> From: Samuel Quintana [mailto:sock.sqt@gmail.com]
> Sent: Mittwoch, 17. April 2013 19:14
> To: Bharath Ganesh
> Cc: users@cxf.apache.org
> Subject: Re: Repeated classes in java2WS
>
> anyone can helpme please?
>
> Thanks a lot.
>
>
> 2013/4/15 Samuel Quintana <so...@gmail.com>
>
> > Hi all:
> >
> > I hope that can help me. I need create the WSDL file and then create a
> > clien with ant task, but when i run the task the generated namespaces
> > of my DTOs aren't respected, for example, original the namespace is
> > *com.oz.dto* for all dto's pojos and *com.oz.ws.sei.register* for SEI
> Interface:
> >
> > - *com.oz.ws.sei.register*
> > - RegisterSEI
> > - *com.oz.dto
> > *
> > - UserDto
> > - PersonDto
> > - AddressDto
> >
> > but the generated client code create only one package(*
> > com.oz.ws.sei.register*), in this package all classes are put, like this.
> >
> > - *com.oz.ws.sei.register*
> > - RegisterSEI
> > - *UserDto*
> > - *PersonDto*
> > - *AddressDto*
> >
> > In the parameter SEI method i define:
> >
> > @WebMethod
> > Integer register(
> >
> > @WebParam(name = "companyId") Integer companyId,
> >
> > *@WebParam(name = "user", targetNamespace =
> "http://ws.oz.com/dto")
> > UserDto user*
> >
> > );
> >
> > but this generate the following:
> >
> > - *com.oz.ws.definitions*
> > - RegisterSEI
> > - *UserDto*
> > - *PersonDto*
> > - *AddressDto*
> > - *com.oz.dto
> > *
> > - *ObjectFactory*
> >
> > The main problem is when i define a new SEI that share dto's with
> > another SEI. The generated code result is as follow:
> >
> > - com.oz.ws.sei.*register*
> > - RegisterSEI
> > - *UserDto*
> > - *PersonDto*
> > - *AddressDto*
> > - com.oz.ws.sei.*recovery*
> > - RecoverySEI
> > - *UserDto*
> > - *PersonDto*
> > - *AddressDto*
> >
> > As you can see, the dto's are repeated for each package when they are
> > invoked, how can say to generator that respect my packages?
> >
> > Thanks a lot for your time.
> >
Re: Repeated classes in java2WS
Posted by Samuel Quintana <so...@gmail.com>.
anyone can helpme please?
Thanks a lot.
2013/4/15 Samuel Quintana <so...@gmail.com>
> Hi all:
>
> I hope that can help me. I need create the WSDL file and then create a
> clien with ant task, but when i run the task the generated namespaces of my
> DTOs aren't respected, for example, original the namespace is *com.oz.dto* for
> all dto's pojos and *com.oz.ws.sei.register* for SEI Interface:
>
> - *com.oz.ws.sei.register*
> - RegisterSEI
> - *com.oz.dto
> *
> - UserDto
> - PersonDto
> - AddressDto
>
> but the generated client code create only one package(*
> com.oz.ws.sei.register*), in this package all classes are put, like this.
>
> - *com.oz.ws.sei.register*
> - RegisterSEI
> - *UserDto*
> - *PersonDto*
> - *AddressDto*
>
> In the parameter SEI method i define:
>
> @WebMethod
> Integer register(
>
> @WebParam(name = "companyId") Integer companyId,
>
> *@WebParam(name = "user", targetNamespace = "http://ws.oz.com/dto")
> UserDto user*
>
> );
>
> but this generate the following:
>
> - *com.oz.ws.definitions*
> - RegisterSEI
> - *UserDto*
> - *PersonDto*
> - *AddressDto*
> - *com.oz.dto
> *
> - *ObjectFactory*
>
> The main problem is when i define a new SEI that share dto's with another
> SEI. The generated code result is as follow:
>
> - com.oz.ws.sei.*register*
> - RegisterSEI
> - *UserDto*
> - *PersonDto*
> - *AddressDto*
> - com.oz.ws.sei.*recovery*
> - RecoverySEI
> - *UserDto*
> - *PersonDto*
> - *AddressDto*
>
> As you can see, the dto's are repeated for each package when they are
> invoked, how can say to generator that respect my packages?
>
> Thanks a lot for your time.
>