Oracle Interval Day To Second type & WCF serial.

Posts   
 
    
YvesVD
User
Posts: 177
Joined: 19-Oct-2006
# Posted on: 01-Aug-2008 15:19:05   

Hi,

My nullable Interval Day To Second type has been properly translated into a TimeSpan? .Net type. I'm passing an entity containing a duration field from the client machine to the server through WCF (MSMQ binding). At client side the duration field value is valid but after serialization in MSMQ and reception of the IEntity2 parameter in the service implementation the value gets corrupted. If I debug the value it says Duration threw an exception of type 'System.InvalidCastException and the insert in oracle throws ORA-1867: the interval is invalid.

Please help.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39866
Joined: 17-Aug-2003
# Posted on: 01-Aug-2008 18:46:36   

What's the value after deserialization? You can determine that via the CurrentValue property of the field object. What's the type as well?

Frans Bouma | Lead developer LLBLGen Pro
YvesVD
User
Posts: 177
Joined: 19-Oct-2006
# Posted on: 01-Aug-2008 20:59:52   

THe CurrentValue (entity.Fields["Duration"].CurrentValue) is the following "00:00:03.5313404". Which seems OK. If I call entity.Fields["Duration"].CurrentValue.GetType() I get {Name = "String" FullName = "System.String"}. I would have expect TimeSpan.

Thanks.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39866
Joined: 17-Aug-2003
# Posted on: 02-Aug-2008 11:22:38   

Every type is serialized to strings, as XML is just text. Deserialization then should take these strings and convert them back into objects. Timespan isn't a predefined type so the serializer works with text.

This of course doesn't work, so we'll add Timespan to the types which require special care. Expect a new build for v2.5 (and v2.6) early next week (monday) which fixes this.

Frans Bouma | Lead developer LLBLGen Pro
YvesVD
User
Posts: 177
Joined: 19-Oct-2006
# Posted on: 02-Aug-2008 13:20:21   

Many thanks.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39866
Joined: 17-Aug-2003
# Posted on: 04-Aug-2008 10:19:47   

Could you try the attached dll to see if it fixes your problem? You've to test it at the side where deserialization takes place, as the error is in hte deserialization code.

Frans Bouma | Lead developer LLBLGen Pro
YvesVD
User
Posts: 177
Joined: 19-Oct-2006
# Posted on: 04-Aug-2008 10:51:05   

It works now.