You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Sam <sa...@gmail.com> on 2007/12/14 16:09:32 UTC

wsdl2java and broken beans: Date->Calendar

Hi!
I'm using java2wsdl and wsdl2java, wsdl2java is re-generating my beans
to add all the serialization/deserialization code in them.
The problem is that these generated beans are broken, my code don't
work with them...
The fields of java.util.Date datatype are translated into
java.util.Calendar type, so, the domain code don't work anymore..

I have an ant task that compiles the modified beans and overwrite the
compiled classes with them. So, I'm doing the right thing?
Should I be using the modified beans instead of the regular ones in my
domain code? How could I solve the types issue?

Maybe it is that I do not fully understand the framework yet, I'll
really appreciate any tip or link to help me to solve this problem,
Thanks in advance

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: wsdl2java and broken beans: Date->Calendar

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Sam wrote:
> Certainly, I cannot change the domain beans, it is code from a client,
> I just have to implement an axis layer.
> I don't know where to put the cast that you mention... My problem is
> that the tool re-generates my beans and the domain code doesn't work
> anymore, because the getters and setters are changed.
> Someone suggested me to use DTOs instead and to forget the idea of use
> the domain beans to transport data, maybe it is the best choice.. I
> don't really know
>   
Yes I also encounter the issues in java2wsdl and will commit the fix
soon. At the moment we are representing java.util.Date as xsd:datatime
filed instead of xsd:data

Thanks
Deepal


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: wsdl2java and broken beans: Date->Calendar

Posted by Sam <sa...@gmail.com>.
Certainly, I cannot change the domain beans, it is code from a client,
I just have to implement an axis layer.
I don't know where to put the cast that you mention... My problem is
that the tool re-generates my beans and the domain code doesn't work
anymore, because the getters and setters are changed.
Someone suggested me to use DTOs instead and to forget the idea of use
the domain beans to transport data, maybe it is the best choice.. I
don't really know

On Dec 14, 2007 3:53 PM, Anne Thomas Manes <at...@gmail.com> wrote:
> JAX-RPC specifies that xsd:date maps to java.util.Calendar. That's why
> wsdl2java is generating a Calendar type. Can you convert your domain
> code to use Calendar instead of Date? If not, I suggest that you cast
> the Calendar types to Date types.
>
> Anne
>
>
> On Dec 14, 2007 10:09 AM, Sam <sa...@gmail.com> wrote:
> > Hi!
> > I'm using java2wsdl and wsdl2java, wsdl2java is re-generating my beans
> > to add all the serialization/deserialization code in them.
> > The problem is that these generated beans are broken, my code don't
> > work with them...
> > The fields of java.util.Date datatype are translated into
> > java.util.Calendar type, so, the domain code don't work anymore..
> >
> > I have an ant task that compiles the modified beans and overwrite the
> > compiled classes with them. So, I'm doing the right thing?
> > Should I be using the modified beans instead of the regular ones in my
> > domain code? How could I solve the types issue?
> >
> > Maybe it is that I do not fully understand the framework yet, I'll
> > really appreciate any tip or link to help me to solve this problem,
> > Thanks in advance
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: wsdl2java and broken beans: Date->Calendar

Posted by Anne Thomas Manes <at...@gmail.com>.
JAX-RPC specifies that xsd:date maps to java.util.Calendar. That's why
wsdl2java is generating a Calendar type. Can you convert your domain
code to use Calendar instead of Date? If not, I suggest that you cast
the Calendar types to Date types.

Anne

On Dec 14, 2007 10:09 AM, Sam <sa...@gmail.com> wrote:
> Hi!
> I'm using java2wsdl and wsdl2java, wsdl2java is re-generating my beans
> to add all the serialization/deserialization code in them.
> The problem is that these generated beans are broken, my code don't
> work with them...
> The fields of java.util.Date datatype are translated into
> java.util.Calendar type, so, the domain code don't work anymore..
>
> I have an ant task that compiles the modified beans and overwrite the
> compiled classes with them. So, I'm doing the right thing?
> Should I be using the modified beans instead of the regular ones in my
> domain code? How could I solve the types issue?
>
> Maybe it is that I do not fully understand the framework yet, I'll
> really appreciate any tip or link to help me to solve this problem,
> Thanks in advance
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org