You are right, .NET cannot guess that my value should be a float. Having said 
this an issue still remains. I believe Flex types any numerical value as a 
"Number" in an Object. The problem is that when we debug on the .Net side we 
get an int for the corresonding Number in flex. An int is only encoded on one 
byte and therefor cannot hold decimal values. Weborb should translate a 
"Number" to a "double" and then casting could work. I have read this on the 
weborb forum but i'm not sure the issue was resolved.

Anyway, to circumvent my problem i am sending a JSON object instead of an AS 
Object and saving it as is in the DB.

Thanks for your help.
T.

--- In [email protected], "valdhor" <valdhorli...@...> wrote:
>
> With no strong typing on either the Flex or .NET side, how is .NET supposed 
> to figure out the data type for you?
> 
> WebORB is just a set of classes and methods built in a specific language 
> (.NET in this case). If .NET passes WebORB a chunk of bytes, how is WebORB 
> meant to figure out that it contains a string, int, float or whatever?
> 
> You will have to type these properties at some point in time.
> 
> If it were me, I would try to coerce a value to an int first. If there was an 
> error, try a float. If there is still an error, try a string.
> 
> 
> --- In [email protected], "gordofeatherfoot" <anthony.janssens@> 
> wrote:
> >
> > First off thanks for your reply,
> > 
> > 1. The corresonding object on the .NET side is a Dictionnary (which is the 
> > equivalent of the Object in AS3 I believe). So the properties are not typed.
> > 
> > 2. I can't send a string and explicitly cast it to a float because the 
> > object i am sending is dynamic (this is why we use the generic Object in 
> > AS3). It will have an unknown numer of properties of various types. 
> > 
> > I could setup a mechanisme whereby i send the type of the property with the 
> > value and then parse the object on the .net side and cast each property to 
> > it's specific type. 
> > But that seems very heavy for this simple problem.
> > 
> > I would have excpected weborb to be able to make the difference between an 
> > intger and a float in a dynamic object comming from Flex.
> > 
> > 
> > --- In [email protected], "valdhor" <valdhorlists@> wrote:
> > >
> > > I don't use .NET (I use PHP) but two things off the top of my head...
> > > 
> > > The property of the corresponding object on the .NET side is typed as an 
> > > int.
> > > 
> > > You are actually sending what looks like an int so .NET is coercing it 
> > > for you.
> > > 
> > > You could also try sending the property as a string and then coercing it 
> > > to a float on the .NET side.
> > > 
> > > 
> > > --- In [email protected], "gordofeatherfoot" <anthony.janssens@> 
> > > wrote:
> > > >
> > > > Hello all,
> > > > 
> > > > I don't know if it this is the right place to ask but i have had little 
> > > > (not to say no) feedback from the weborb forum, so i apologize if this 
> > > > is not appropriate.
> > > > 
> > > > I am sending a simple AS3 Object to my .net backend through weborb. 
> > > > This object has a property 'foo' with a decimal value. This object gets 
> > > > mapped to a dictionnary in .net but the value of 'foo' is serialized to 
> > > > an integer.
> > > > 
> > > > Anyone have an idea of why this is?
> > > > 
> > > > Thanks,
> > > > Tony.
> > > >
> > >
> >
>


Reply via email to