You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Tophebboy <cb...@gmail.com> on 2007/12/04 08:57:03 UTC

Newbie to web services => objects conversion???

Hi!
I'm a newbie to web services and I'm trying to build an application using
CXF.
Here is my problem:
The entities I use are represented by interfaces in my client application.
Let's call them "client interfaces".
There are 3 big components in my application:
The client (in Eclipse RCP), the web services part, and a server.
In the server, some work is done by another team.
I design the client interfaces, the client and the web services part.
I give the client interfaces to the other team. This team returns me objects
implementing my interfaces.
The problem is that when I create a SEI with methods returning instances of
classes implementing my interfaces (or lists of those classes), CXF builds
new classes which have the same methods as my interfaces but which do not
implement them, and the resulting web service uses those classes.
So I made some utility classes to convert "services" objects to "interface"
objets and "interface" objects to "services" objects. There are lots of
methods in my interfaces, so I used the reflection API when it was possible.
But I'm really wondering: is there any "cleaner" way to do all that stuff?
Is there a way to avoid the objects conversion?
Thanks a lot in advance!
Chris
-- 
View this message in context: http://www.nabble.com/Newbie-to-web-services-%3D%3E-objects-conversion----tf4941627.html#a14146152
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Newbie to web services => objects conversion???

Posted by Tophebboy <cb...@gmail.com>.
The problem is that those interfaces are also used in other components. I
mean, I may have to use a plugin which uses something else and not CXF, but
this plugin have to use the same interfaces.
I can't let every component used by my application rely on the classes
generated by CXF. Every part have to be independant and the glue between all
the components are those interfaces...



Glen Mazza-2 wrote:
> 
> Can't you rely on the JAX-WS classes created directly?  Why do you need
> to create the client interfaces to begin with?  Can't you rely on the
> WSDL as a contract with the other team?
> 
> Glen
> 
> 
> Am Montag, den 03.12.2007, 23:57 -0800 schrieb Tophebboy:
>> Hi!
>> I'm a newbie to web services and I'm trying to build an application using
>> CXF.
>> Here is my problem:
>> The entities I use are represented by interfaces in my client
>> application.
>> Let's call them "client interfaces".
>> There are 3 big components in my application:
>> The client (in Eclipse RCP), the web services part, and a server.
>> In the server, some work is done by another team.
>> I design the client interfaces, the client and the web services part.
>> I give the client interfaces to the other team. This team returns me
>> objects
>> implementing my interfaces.
>> The problem is that when I create a SEI with methods returning instances
>> of
>> classes implementing my interfaces (or lists of those classes), CXF
>> builds
>> new classes which have the same methods as my interfaces but which do not
>> implement them, and the resulting web service uses those classes.
>> So I made some utility classes to convert "services" objects to
>> "interface"
>> objets and "interface" objects to "services" objects. There are lots of
>> methods in my interfaces, so I used the reflection API when it was
>> possible.
>> But I'm really wondering: is there any "cleaner" way to do all that
>> stuff?
>> Is there a way to avoid the objects conversion?
>> Thanks a lot in advance!
>> Chris
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Newbie-to-web-services-%3D%3E-objects-conversion----tf4941627.html#a14150412
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Newbie to web services => objects conversion???

Posted by Glen Mazza <gl...@verizon.net>.
Can't you rely on the JAX-WS classes created directly?  Why do you need
to create the client interfaces to begin with?  Can't you rely on the
WSDL as a contract with the other team?

Glen


Am Montag, den 03.12.2007, 23:57 -0800 schrieb Tophebboy:
> Hi!
> I'm a newbie to web services and I'm trying to build an application using
> CXF.
> Here is my problem:
> The entities I use are represented by interfaces in my client application.
> Let's call them "client interfaces".
> There are 3 big components in my application:
> The client (in Eclipse RCP), the web services part, and a server.
> In the server, some work is done by another team.
> I design the client interfaces, the client and the web services part.
> I give the client interfaces to the other team. This team returns me objects
> implementing my interfaces.
> The problem is that when I create a SEI with methods returning instances of
> classes implementing my interfaces (or lists of those classes), CXF builds
> new classes which have the same methods as my interfaces but which do not
> implement them, and the resulting web service uses those classes.
> So I made some utility classes to convert "services" objects to "interface"
> objets and "interface" objects to "services" objects. There are lots of
> methods in my interfaces, so I used the reflection API when it was possible.
> But I'm really wondering: is there any "cleaner" way to do all that stuff?
> Is there a way to avoid the objects conversion?
> Thanks a lot in advance!
> Chris