Flex and dot.net will exchange xml just fine. With HTTPService, I typically send the xml back and forth as strings, but with webservices, I let .net generate the SOAP, which I consume in Flex without problem.
The way I handle update is this: when a Flex control updates some local data, I set an attribute, datamodified="true" on the node whose text node was modified, and I set that attribute op the parent chain as well. When the user clicks save, I process the xml model and send only the nodes flagged as datamodified to the server. .Net parses the xml and adds updates or deletes the corresponding database rows (I also use an "action" attribute on modified nodes to specify delete or new records.) Tracy Spratt, Lariat Services, development services available _____ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Sam Lai Sent: Sunday, June 07, 2009 11:35 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Flex and .NET Considering the time required for serialization/deserialization, using something like webORB would improve parsing time, as it uses a binary format which can be parsed more easily than a text format. But unless you're using large datasets/doing lots of web service calls, the advantages are probably negligible. Are you transmitting everything in the array collection back to the web service, or just the IDs of the selected rows? Transferring everything including the row data would remove the need for another database hit, but for large datasets, that could be quite a bit of traffic. I'd say it would be better just to transmit the IDs back to the webservice, and let the webservice hit the database for the row data (some caching on the server-side would help too). 2009/6/8 Angelo Anolin <angelo_anolin@ <mailto:angelo_anolin%40yahoo.com> yahoo.com>: > > > > Hi Sam, > > Thanks for your reply. > > As of now, I actually prefer to utilize what I know on .NET and what I am > learning on Flex. Adding another utility (Web Orb) in my learning process > may complicate things a bit. I might consult this later if I feel that the > needs for is getting tremendous. > > Anyway, I am actually able to generate the report from what I am currently > doing (no error encountered), where the ArrayCollection I am parsing into a > delimited string, passing the string to the webservice call, and letting the > webservice de-serialize the string to populate a Crystal report document > which I subsequentlt display in another browser window which I call from the > Flex application. > > I mentioned that I did not feel it is the "BEST" way because I am literally > storing all datagrid (report) information in a string variable. Assuming > for example that the data displayed in the datagrid is quite huge, then > creating the delimited string would take some time and additional processing > time could also be consumbed by the back end web service to parse the string > and populate the report. > > As of now, this is what the application does. > 1. Flex App calls a webservice to retrieve data. > 2. WebService responds by sending back a dataset which is returned as a > string (via Dataset.GetXML method of .NET). > 3. Flex App gets the service response, converts the string into an XML. > 4. Flex App converts the XML data into an ArrayCollection which is bound to > the datagrid. > * Please note that I used array collection here for the search/filter > functionality of the datagrid. > 5. When generating print out of the data displayed in the datagrid, Flex > would then serialize the ArrayCollection into a delimited string and send it > to the web service. > 6. Web Service would then de-serialize (or parse) the string, populate a > .NET dataset which is the datasource for the Crystal report. > 7. Crystal report is bound and PDF report is generated. > 8. Flex displays via external javascript call the PDF report generated. > > Is there a better way for the ArrayCollection to be sent to the webservice, > the webservice in turn would just convert it to dataset and the dataset is > immediately bound to the Crystal report? > > Thanks. > > Regards, > > Angelo > ________________________________ > From: Sam Lai <samuel....@gmail. <mailto:samuel.lai%40gmail.com> com> > To: flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com > Sent: Monday, 8 June, 2009 8:49:36 > Subject: Re: [flexcoders] Flex and .NET > > 2009/6/8 Angelo Anolin <angelo_anolin@ yahoo.com>: > >> I feel that this is probably not the "BEST" way of doing this. I tried >> initially to pass an XML delimmited string, but .NET seems to read XML >> differently( ?) from Flex. > > I'd say XML would be a good way of doing it. What kind of errors are > you getting, and how are you making the web service call? > > The other option is to use AMF, a native messaging format for > Flash/Flex. This I believe would save you the effort of serializing > and deserializing - it does it for you, among other things. > > http://www.themidni ghtcoders. com/products/ weborb-for- net/overview. html > > > >