Thank you, Keith. That worked well.

Scott

-----Original Message-----
From: Keith Visco [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 14, 2004 10:20 PM
To: [EMAIL PROTECTED]
Subject: Re: [castor-user] Why double fields always have default value
of 0.0



Scott,

Java primitives have these default values, there is nothing Castor can
do to work around this. So the best solution is to use the java
primitive wrappers, such as java.lang.Integer. If you are using
SourceGenerator code, you can either check the "hasXXX" that is
generated to determine if the primitive field was actually existed in
the XML file, or you can set the castorbuilder.properties to have the
SourceGenerator use the java primitive wrapper classes.

--Keith


> "Liu, Scott" wrote:
> 
> Hi, All,
> 
> 
> 
> You may have noticed this or have an explanation. Recently I noticed
> that even if a client dose not provide any values to double fields I
> always see "0.0" at the server end in my web services. For example I
> have a field called "amount" in a sales order transaction and I would
> like to deny the service if the "amount' is not provided (for other
> reasons I have selected to treat the amount as an optional field). I
> have verified that the xml resulted to send cross the wire did not
> have any amount element. Now somewhere in the process a default value
> is added to the "amount" thus I can not reject the transaction based
> on an empty "amount" field. This also happens on integer fields which
> have "0" default values.
> 
> 
> 
> Please share me with your insight and solutions,
> 
> 
> 
> Thanks,
> 
> 
> 
> Scott
> 
> 
> 
> 
> 
>     ---------------------------------------------------------------
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-user



----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

Reply via email to