Copy link to clipboard
Copied
Hi,
I am using http to get data from a database not included in the standard options for data services. That's fine I have been able to get data.
The problem I am now facing is the database has about 150 tables many with upwards of 100 columns. It would be very nice to be able to write some generic CRUD data services and pass the table name and assign the result to a particular Value Object.
The biggest problem I'm having is data typing. I can use the data service to get a sample return result with all the fields from the database, but I don't really want to have to go through every field returned and manually set it's data type – especially when I (obviously) know the data type on the server.
Any ideas about how to tackle this?
regards
Chris
Copy link to clipboard
Copied
This might help you.
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/rpc/http/SerializationFilter.html
It will help you to convert an object to XML and vice-versa to work with strong types when using a HTTPService.
The serializers.swc shipped with FB and included in your libraries when you use a HTTPService, provides with default deserializers for XML and JSON to convert them to strong types. You can override them and provide your deserializers and serializers.
Hope this helps.
-Sunil
Copy link to clipboard
Copied
Thanks for your tip Sunil. That points me in the right direction.
However it would be nice if I could understand this class. It would be good if Adobe would provide some examples.
As it is, I get the basic idea, but I don't really know how to implement it.
I'll keep looking at it though.
thanks again,
Chris