Re: [flexcoders] Re: Flex and .NET
Hi Steve, The dataset which I am using in my Flex app is being edited, with some records added or deleted or filtered. As I am doing this in the Flex application, the backend service (web service) does not know which have been modified, thus, I need to send back the current data I have in the Flex application. By the way, some updates on this. I tried to send the ArrayCollection as it is in .NET and I am getting the same as an ArrayList, which contains XML document tags. The only beef with this is that there is no actual tag for the field (column), so I have no idea which column to actually map back to the dataset. I am going to field portions of the data returned back tomorrow, as my codes are all in my office machine. Thanks and regards, Angelo From: valdhor valdhorli...@embarqmail.com To: flexcoders@yahoogroups.com Sent: Tuesday, 9 June, 2009 21:31:56 Subject: [flexcoders] Re: Flex and .NET I don't understand why you would send the entire data set back to your .NET backend via the web service. The backend has already generated the data to be sent and the backend is what generates the report via Crystal Reports. I would have thought the best way was to send the query back to the back end, get it to do the data lookup again and pass the data into Crystal Reports. HTH Steve --- In flexcod...@yahoogro ups.com, Angelo Anolin angelo_anolin@ ... wrote: 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.lai@ ... To: flexcod...@yahoogro 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
RE: [flexcoders] Re: Flex and .net webservices
Thanks Ben, Changing the data type to Number didn't help either. I'll have a look at Darron's solution ... Cheers Robin From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ben.clinkinbeard Sent: Tuesday, 12 December 2006 4:56 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Flex and .net webservices Might want to try making employeeID a Number instead of an int. If that doesn't work use this: http://www.darronschall.com/weblog/archives/000247.cfm http://www.darronschall.com/weblog/archives/000247.cfm HTH, Ben --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Robin Burrer [EMAIL PROTECTED] wrote: Thanks Ben, I tried that. It still does not work ..:-(. I got rid of everything which could cause errors. ... Here's the code. I reckon this is as basic as it gets ... public function onMyResult(event:ResultEvent):void { // this works fine var myObject:Object = Object(event.result); // this causes an error (Error #1034: Type Coercion failed: cannot convert [EMAIL PROTECTED] to webserviceClasses.Employee.) var myEmployee:Employee = Employee(event.result); // does not work trace (myEmployee.employeeName); // does work trace (myObject.employeeName); } ]] /// the web service object /mx:Script mx:WebService showBusyCursor=true wsdl=http://localhost/ComplexDataTypeService/Service1.asmx?WSDL http://localhost/ComplexDataTypeService/Service1.asmx?WSDL id=myWebservice makeObjectsBindable=false mx:operation name=getDetails result={ onMyResult (event)} resultFormat=object/ /mx:WebService // the Employee object: public class Employee (AS) { public var employeeName:String; public var employeeID:int; } (c#) public class Employee { public string employeeName; public int employeeID; } Any ideas? Robin From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com ] On Behalf Of ben.clinkinbeard Sent: Tuesday, 12 December 2006 2:02 PM To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com Subject: [flexcoders] Re: Flex and .net webservices Hi Robin, I have good news :), both of these issues should go away by setting a single attribute on your WebService object. Try setting makeObjectsBindable = false. This will cause Flex to deserialize your ws responses into regular Object and Array instances instead of ObjectProxy and ArrayCollection instances. HTH, Ben --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com mailto:flexcoders%40yahoogroups.com , Robin Burrer rburrer@ wrote: Hi there, I have been playing around .net and flex for a while. Primarily I want to send value objects (consisting of strings, intergers and arrays of VOs) back and forth. I could not figure out how to do the following things though: 1. Sending arrays to a webservice works fine. However when I receive an array of the .net data type array flex creates and Array Collection data type. Sending arrays as array collections to a web service causes an error. That's really annoying when you try to keep the VOs consitent on both ends. What's the solution for this? 2. When I receive a complex data type from a .net web service flex creates an Object but when I try to cast this object to the dataType it represents I get a complier error, even though the received object has exactly the same properties as underlying VO. E.g. I get the following error code if I try to cast the result of a webservice call to my custom data Type TelephoneNumber. Note casting to an Object works fine. TypeError: Error #1034: Type Coercion failed: cannot convert mx.utils::[EMAIL PROTECTED] to webserviceClasses.TelephoneNumber. Any help is highly appreciated. Robin
Re: [flexcoders] Re: Flex and .net webservices
Robin: It sounds like you may be looking for a Remoting Gateway which uses AMF rather than Web Services and has the ability to translate .NET - AS Objects. I've got articles written on two different options, Fluorine and WebOrb. http://blog.shrefler.net/?p=6 http://blog.shrefler.net/?p=10 Hope that helps Sam On 12/12/06, Robin Burrer [EMAIL PROTECTED] wrote: Darron's ObjectTranslator works perfectly – thanks for the tip! I still have to do some manual work though since I'm going to have nested VOs…. R -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Robin Burrer *Sent:* Tuesday, 12 December 2006 3:32 PM *To:* flexcoders@yahoogroups.com *Subject:* RE: [flexcoders] Re: Flex and .net webservices Thanks Ben, I tried that. It still does not work ..:-(. I got rid of everything which could cause errors. … Here's the code. I reckon this is as basic as it gets … public function onMyResult(event:ResultEvent):void { // this works fine var myObject:Object = Object(event.result); // this causes an error (Error #1034: Type Coercion failed: cannot convert [EMAIL PROTECTED] to webserviceClasses.Employee.) var myEmployee:Employee = Employee(event.result); // does not work trace ( myEmployee.employeeName); // does work trace ( myObject.employeeName); } ]] /// the web service object /mx:Script mx:WebService showBusyCursor=true wsdl=http://localhost/ComplexDataTypeService/Service1.asmx?WSDL; id=myWebservice makeObjectsBindable=false mx:operation name=getDetails result={ onMyResult (event)} resultFormat=object/ /mx:WebService // the Employee object: public class Employee (AS) { public var employeeName:String; public var employeeID:int; } (c#) public class Employee { public string employeeName; public int employeeID; } Any ideas? Robin -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *ben.clinkinbeard *Sent:* Tuesday, 12 December 2006 2:02 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] Re: Flex and .net webservices Hi Robin, I have good news :), both of these issues should go away by setting a single attribute on your WebService object. Try setting makeObjectsBindable = false. This will cause Flex to deserialize your ws responses into regular Object and Array instances instead of ObjectProxy and ArrayCollection instances. HTH, Ben --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Robin Burrer [EMAIL PROTECTED] wrote: Hi there, I have been playing around .net and flex for a while. Primarily I want to send value objects (consisting of strings, intergers and arrays of VOs) back and forth. I could not figure out how to do the following things though: 1. Sending arrays to a webservice works fine. However when I receive an array of the .net data type array flex creates and Array Collection data type. Sending arrays as array collections to a web service causes an error. That's really annoying when you try to keep the VOs consitent on both ends. What's the solution for this? 2. When I receive a complex data type from a .net web service flex creates an Object but when I try to cast this object to the dataType it represents I get a complier error, even though the received object has exactly the same properties as underlying VO. E.g. I get the following error code if I try to cast the result of a webservice call to my custom data Type TelephoneNumber. Note casting to an Object works fine. TypeError: Error #1034: Type Coercion failed: cannot convert mx.utils::[EMAIL PROTECTED] to webserviceClasses.TelephoneNumber. Any help is highly appreciated. Robin
Re: [flexcoders] Re: Flex and .net webservices
Try ObjectUtil.toString(myObject) Patrick Robin Burrer a écrit : Thanks Ben, I tried that. It still does not work ..:-(. I got rid of everything which could cause errors. … Here’s the code. I reckon this is as basic as it gets … public function onMyResult(event: ResultEvent) :void { // this works fine var myObject:Object = Object(event. result); // this causes an error ( Error #1034: Type Coercion failed: cannot convert [EMAIL PROTECTED] to webserviceClasses. Employee. ) var myEmployee:Employee = Employee(event. result); // does not work trace (myEmployee. employeeName) ; // does work trace (myObject.employeeN ame); } ]] /// the web service object /mx:Script mx:WebService showBusyCursor=true wsdl=http://localhost/ ComplexDataTypeS ervice/Service1. asmx?WSDL id=myWebservice makeObjectsBindable =false mx:operation name=getDetails result={ onMyResult (event)} resultFormat=object/ /mx:WebService // the Employee object: public class Employee (AS) { public var employeeName: String; public var employeeID:int; } (c#) public class Employee { public string employeeName; public int employeeID; } Any ideas? Robin * From: * [EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups. com] *On Behalf Of *ben.clinkinbeard *Sent:* Tuesday, 12 December 2006 2:02 PM *To:* [EMAIL PROTECTED] ups.com *Subject:* [flexcoders] Re: Flex and .net webservices Hi Robin, I have good news :), both of these issues should go away by setting a single attribute on your WebService object. Try setting makeObjectsBindable = false. This will cause Flex to deserialize your ws responses into regular Object and Array instances instead of ObjectProxy and ArrayCollection instances. HTH, Ben --- In [EMAIL PROTECTED] ups.com mailto:flexcoders%40yahoogroups.com, Robin Burrer [EMAIL PROTECTED] wrote: Hi there, I have been playing around .net and flex for a while. Primarily I want to send value objects (consisting of strings, intergers and arrays of VOs) back and forth. I could not figure out how to do the following things though: 1. Sending arrays to a webservice works fine. However when I receive an array of the .net data type array flex creates and Array Collection data type. Sending arrays as array collections to a web service causes an error. That's really annoying when you try to keep the VOs consitent on both ends. What's the solution for this? 2. When I receive a complex data type from a .net web service flex creates an Object but when I try to cast this object to the dataType it represents I get a complier error, even though the received object has exactly the same properties as underlying VO. E.g. I get the following error code if I try to cast the result of a webservice call to my custom data Type TelephoneNumber . Note casting to an Object works fine. TypeError: Error #1034: Type Coercion failed: cannot convert mx.utils::ObjectPro [EMAIL PROTECTED] to webserviceClasses. TelephoneNumber. Any help is highly appreciated. Robin -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [flexcoders] Re: Flex and .net webservices
Hi Sam, I've read your tutorial, good stuff. I've been using flourine for a while in different projects but I haven't got the chance to use weborb. As you've tried both of them, I was wondering if you can make a comparison table or a pro and cons of each of them. It would be great. BTW, how do you send nullable objects back and forth? Cheers, Diego. On Wed, 13 Dec 2006 02:08:06 +1300, Sam Shrefler [EMAIL PROTECTED] wrote: Robin: It sounds like you may be looking for a Remoting Gateway which uses AMF rather than Web Services and has the ability to translate .NET - AS Objects. I've got articles written on two different options, Fluorine and WebOrb. http://blog.shrefler.net/?p=6 http://blog.shrefler.net/?p=10 Hope that helps Sam On 12/12/06, Robin Burrer [EMAIL PROTECTED] wrote: Darron's ObjectTranslator works perfectly – thanks for the tip! I still have to do some manual work though since I'm going to have nested VOs…. R -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Robin Burrer *Sent:* Tuesday, 12 December 2006 3:32 PM *To:* flexcoders@yahoogroups.com *Subject:* RE: [flexcoders] Re: Flex and .net webservices Thanks Ben, I tried that. It still does not work ..:-(. I got rid of everything which could cause errors. … Here's the code. I reckon this is as basic as it gets … public function onMyResult(event:ResultEvent):void { // this works fine var myObject:Object = Object(event.result); // this causes an error (Error #1034: Type Coercion failed: cannot convert [EMAIL PROTECTED] to webserviceClasses.Employee.) var myEmployee:Employee = Employee(event.result); // does not work trace ( myEmployee.employeeName); // does work trace ( myObject.employeeName); } ]] /// the web service object /mx:Script mx:WebService showBusyCursor=true wsdl=http://localhost/ComplexDataTypeService/Service1.asmx?WSDL; id=myWebservice makeObjectsBindable=false mx:operation name=getDetails result={ onMyResult (event)} resultFormat=object/ /mx:WebService // the Employee object: public class Employee (AS) { public var employeeName:String; public var employeeID:int; } (c#) public class Employee { public string employeeName; public int employeeID; } Any ideas? Robin -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *ben.clinkinbeard *Sent:* Tuesday, 12 December 2006 2:02 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] Re: Flex and .net webservices Hi Robin, I have good news :), both of these issues should go away by setting a single attribute on your WebService object. Try setting makeObjectsBindable = false. This will cause Flex to deserialize your ws responses into regular Object and Array instances instead of ObjectProxy and ArrayCollection instances. HTH, Ben --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Robin Burrer [EMAIL PROTECTED] wrote: Hi there, I have been playing around .net and flex for a while. Primarily I want to send value objects (consisting of strings, intergers and arrays of VOs) back and forth. I could not figure out how to do the following things though: 1. Sending arrays to a webservice works fine. However when I receive an array of the .net data type array flex creates and Array Collection data type. Sending arrays as array collections to a web service causes an error. That's really annoying when you try to keep the VOs consitent on both ends. What's the solution for this? 2. When I receive a complex data type from a .net web service flex creates an Object but when I try to cast this object to the dataType it represents I get a complier error, even though the received object has exactly the same properties as underlying VO. E.g. I get the following error code if I try to cast the result of a webservice call to my custom data Type TelephoneNumber. Note casting to an Object works fine. TypeError: Error #1034: Type Coercion failed: cannot convert mx.utils::[EMAIL PROTECTED] to webserviceClasses.TelephoneNumber. Any help is highly
Re: [flexcoders] Re: Flex and .net webservices
Diego: First: Compare...I haven't used WebOrb at all past that. So my table consists of: Free vs Paid - i've chosen free at this point. WebOrb looks like an awesome product always being updated, but ihaven't had the need/chance to use it yet Second: Nullable objects! Ah yes...something I beat my head against the desk for quite some time with DateTimes. in .NET: public NullableDateTime myDateTime; Nothing changes in Flex. Hope that helps Sam On 12/12/06, Diego Guebel [EMAIL PROTECTED] wrote: Hi Sam, I've read your tutorial, good stuff. I've been using flourine for a while in different projects but I haven't got the chance to use weborb. As you've tried both of them, I was wondering if you can make a comparison table or a pro and cons of each of them. It would be great. BTW, how do you send nullable objects back and forth? Cheers, Diego. On Wed, 13 Dec 2006 02:08:06 +1300, Sam Shrefler [EMAIL PROTECTED]sshrefler%40gmail.com wrote: Robin: It sounds like you may be looking for a Remoting Gateway which uses AMF rather than Web Services and has the ability to translate .NET - AS Objects. I've got articles written on two different options, Fluorine and WebOrb. http://blog.shrefler.net/?p=6 http://blog.shrefler.net/?p=10 Hope that helps Sam On 12/12/06, Robin Burrer [EMAIL PROTECTED] rburrer%40hubb.com wrote: Darron's ObjectTranslator works perfectly – thanks for the tip! I still have to do some manual work though since I'm going to have nested VOs…. R -- *From:* flexcoders@yahoogroups.com flexcoders%40yahoogroups.com[mailto: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com] *On Behalf Of *Robin Burrer *Sent:* Tuesday, 12 December 2006 3:32 PM *To:* flexcoders@yahoogroups.com flexcoders%40yahoogroups.com *Subject:* RE: [flexcoders] Re: Flex and .net webservices Thanks Ben, I tried that. It still does not work ..:-(. I got rid of everything which could cause errors. … Here's the code. I reckon this is as basic as it gets … public function onMyResult(event:ResultEvent):void { // this works fine var myObject:Object = Object(event.result); // this causes an error (Error #1034: Type Coercion failed: cannot convert [EMAIL PROTECTED] to webserviceClasses.Employee.) var myEmployee:Employee = Employee(event.result); // does not work trace ( myEmployee.employeeName); // does work trace ( myObject.employeeName); } ]] /// the web service object /mx:Script mx:WebService showBusyCursor=true wsdl=http://localhost/ComplexDataTypeService/Service1.asmx?WSDL; id=myWebservice makeObjectsBindable=false mx:operation name=getDetails result={ onMyResult (event)} resultFormat=object/ /mx:WebService // the Employee object: public class Employee (AS) { public var employeeName:String; public var employeeID:int; } (c#) public class Employee { public string employeeName; public int employeeID; } Any ideas? Robin -- *From:* flexcoders@yahoogroups.com flexcoders%40yahoogroups.com[mailto: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com] *On Behalf Of *ben.clinkinbeard *Sent:* Tuesday, 12 December 2006 2:02 PM *To:* flexcoders@yahoogroups.com flexcoders%40yahoogroups.com *Subject:* [flexcoders] Re: Flex and .net webservices Hi Robin, I have good news :), both of these issues should go away by setting a single attribute on your WebService object. Try setting makeObjectsBindable = false. This will cause Flex to deserialize your ws responses into regular Object and Array instances instead of ObjectProxy and ArrayCollection instances. HTH, Ben --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.comflexcoders%40yahoogroups.com, Robin Burrer [EMAIL PROTECTED] wrote: Hi there, I have been playing around .net and flex for a while. Primarily I want to send value objects (consisting of strings, intergers and arrays of VOs) back and forth. I could not figure out how to do the following things though: 1. Sending arrays to a webservice works fine. However when I receive an array of the .net data type array flex creates and Array Collection data type. Sending arrays as array collections to a web service causes an error. That's really annoying when you try to keep the VOs consitent on both ends. What's the solution for this? 2. When I receive a complex data type from a .net web service flex creates an Object but when I try to cast this object to the dataType it represents I get a complier error, even though the received object has exactly the same properties as underlying VO. E.g. I get the following error code if I try to cast the result of a webservice call to my custom data Type TelephoneNumber. Note casting to an Object works fine. TypeError: Error #1034: Type
Re: [flexcoders] Re: Flex and .net webservices
Hi Sam, I've made the same decision :D What about nullable boolean and the rest of the possible types? cheers, Diego. On Wed, 13 Dec 2006 09:51:43 +1300, Sam Shrefler [EMAIL PROTECTED] wrote: Diego: First: Compare...I haven't used WebOrb at all past that. So my table consists of: Free vs Paid - i've chosen free at this point. WebOrb looks like an awesome product always being updated, but ihaven't had the need/chance to use it yet Second: Nullable objects! Ah yes...something I beat my head against the desk for quite some time with DateTimes. in .NET: public NullableDateTime myDateTime; Nothing changes in Flex. Hope that helps Sam On 12/12/06, Diego Guebel [EMAIL PROTECTED] wrote: Hi Sam, I've read your tutorial, good stuff. I've been using flourine for a while in different projects but I haven't got the chance to use weborb. As you've tried both of them, I was wondering if you can make a comparison table or a pro and cons of each of them. It would be great. BTW, how do you send nullable objects back and forth? Cheers, Diego. On Wed, 13 Dec 2006 02:08:06 +1300, Sam Shrefler [EMAIL PROTECTED]sshrefler%40gmail.com wrote: Robin: It sounds like you may be looking for a Remoting Gateway which uses AMF rather than Web Services and has the ability to translate .NET - AS Objects. I've got articles written on two different options, Fluorine and WebOrb. http://blog.shrefler.net/?p=6 http://blog.shrefler.net/?p=10 Hope that helps Sam On 12/12/06, Robin Burrer [EMAIL PROTECTED] rburrer%40hubb.com wrote: Darron's ObjectTranslator works perfectly – thanks for the tip! I still have to do some manual work though since I'm going to have nested VOs…. R -- *From:* flexcoders@yahoogroups.com flexcoders%40yahoogroups.com[mailto: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com] *On Behalf Of *Robin Burrer *Sent:* Tuesday, 12 December 2006 3:32 PM *To:* flexcoders@yahoogroups.com flexcoders%40yahoogroups.com *Subject:* RE: [flexcoders] Re: Flex and .net webservices Thanks Ben, I tried that. It still does not work ..:-(. I got rid of everything which could cause errors. … Here's the code. I reckon this is as basic as it gets … public function onMyResult(event:ResultEvent):void { // this works fine var myObject:Object = Object(event.result); // this causes an error (Error #1034: Type Coercion failed: cannot convert [EMAIL PROTECTED] to webserviceClasses.Employee.) var myEmployee:Employee = Employee(event.result); // does not work trace ( myEmployee.employeeName); // does work trace ( myObject.employeeName); } ]] /// the web service object /mx:Script mx:WebService showBusyCursor=true wsdl=http://localhost/ComplexDataTypeService/Service1.asmx?WSDL; id=myWebservice makeObjectsBindable=false mx:operation name=getDetails result={ onMyResult (event)} resultFormat=object/ /mx:WebService // the Employee object: public class Employee (AS) { public var employeeName:String; public var employeeID:int; } (c#) public class Employee { public string employeeName; public int employeeID; } Any ideas? Robin -- *From:* flexcoders@yahoogroups.com flexcoders%40yahoogroups.com[mailto: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com] *On Behalf Of *ben.clinkinbeard *Sent:* Tuesday, 12 December 2006 2:02 PM *To:* flexcoders@yahoogroups.com flexcoders%40yahoogroups.com *Subject:* [flexcoders] Re: Flex and .net webservices Hi Robin, I have good news :), both of these issues should go away by setting a single attribute on your WebService object. Try setting makeObjectsBindable = false. This will cause Flex to deserialize your ws responses into regular Object and Array instances instead of ObjectProxy and ArrayCollection instances. HTH, Ben --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.comflexcoders%40yahoogroups.com, Robin Burrer [EMAIL PROTECTED] wrote: Hi there, I have been playing around .net and flex for a while. Primarily I want to send value objects (consisting of strings, intergers and arrays of VOs) back and forth. I could not figure out how to do the following things though: 1. Sending arrays to a webservice works fine. However when I receive an array of the .net data type array flex creates and Array Collection data type. Sending arrays as array collections to a web service causes an error. That's really annoying when you try to keep the VOs consitent on both ends. What's the solution
RE: [flexcoders] Re: Flex and .net webservices
Hi Sam, Remoting is definitely a good alternative and would probably make things a bit easier. I'm not programming the .net side of things though and the guys who are working on the backend are not too keen on using a technology which is not established standards yet. I had a look at Fluorine earlier this year and it looks very good though Cheers Robin From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Sam Shrefler Sent: Wednesday, 13 December 2006 12:08 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Re: Flex and .net webservices Robin: It sounds like you may be looking for a Remoting Gateway which uses AMF rather than Web Services and has the ability to translate .NET - AS Objects. I've got articles written on two different options, Fluorine and WebOrb. http://blog.shrefler.net/?p=6 http://blog.shrefler.net/?p=6 http://blog.shrefler.net/?p=10 http://blog.shrefler.net/?p=10 Hope that helps Sam On 12/12/06, Robin Burrer [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Darron's ObjectTranslator works perfectly - thanks for the tip! I still have to do some manual work though since I'm going to have nested VOs R From: flexcoders@yahoogroups.com [mailto: flexcoders@ mailto:flexcoders@ yahoogroups.com http://yahoogroups.com ] On Behalf Of Robin Burrer Sent: Tuesday, 12 December 2006 3:32 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: Flex and .net webservices Thanks Ben, I tried that. It still does not work ..:-(. I got rid of everything which could cause errors. ... Here's the code. I reckon this is as basic as it gets ... public function onMyResult(event:ResultEvent):void { // this works fine var myObject:Object = Object(event.result); // this causes an error ( Error #1034: Type Coercion failed: cannot convert [EMAIL PROTECTED] to webserviceClasses.Employee.) var myEmployee:Employee = Employee(event.result); // does not work trace (myEmployee.employeeName); // does work trace (myObject.employeeName); } ]] /// the web service object /mx:Script mx:WebService showBusyCursor=true wsdl=http://localhost/ComplexDataTypeService/Service1.asmx?WSDL; id=myWebservice makeObjectsBindable=false mx:operation name=getDetails result={ onMyResult (event)} resultFormat=object/ /mx:WebService // the Employee object: public class Employee (AS) { public var employeeName:String; public var employeeID:int; } (c#) public class Employee { public string employeeName; public int employeeID; } Any ideas? Robin From: [EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups.com http://yahoogroups.com ] On Behalf Of ben.clinkinbeard Sent: Tuesday, 12 December 2006 2:02 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Flex and .net webservices Hi Robin, I have good news :), both of these issues should go away by setting a single attribute on your WebService object. Try setting makeObjectsBindable = false. This will cause Flex to deserialize your ws responses into regular Object and Array instances instead of ObjectProxy and ArrayCollection instances. HTH, Ben --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Robin Burrer [EMAIL PROTECTED] wrote: Hi there, I have been playing around .net and flex for a while. Primarily I want to send value objects (consisting of strings, intergers and arrays of VOs) back and forth. I could not figure out how to do the following things though: 1. Sending arrays to a webservice works fine. However when I receive an array of the .net data type array flex creates and Array Collection data type
RE: [flexcoders] Re: Flex and .net webservices
Thanks Ben, I tried that. It still does not work ..:-(. I got rid of everything which could cause errors. ... Here's the code. I reckon this is as basic as it gets ... public function onMyResult(event:ResultEvent):void { // this works fine var myObject:Object = Object(event.result); // this causes an error (Error #1034: Type Coercion failed: cannot convert [EMAIL PROTECTED] to webserviceClasses.Employee.) var myEmployee:Employee = Employee(event.result); // does not work trace (myEmployee.employeeName); // does work trace (myObject.employeeName); } ]] /// the web service object /mx:Script mx:WebService showBusyCursor=true wsdl=http://localhost/ComplexDataTypeService/Service1.asmx?WSDL; id=myWebservice makeObjectsBindable=false mx:operation name=getDetails result={ onMyResult (event)} resultFormat=object/ /mx:WebService // the Employee object: public class Employee (AS) { public var employeeName:String; public var employeeID:int; } (c#) public class Employee { public string employeeName; public int employeeID; } Any ideas? Robin From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ben.clinkinbeard Sent: Tuesday, 12 December 2006 2:02 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Flex and .net webservices Hi Robin, I have good news :), both of these issues should go away by setting a single attribute on your WebService object. Try setting makeObjectsBindable = false. This will cause Flex to deserialize your ws responses into regular Object and Array instances instead of ObjectProxy and ArrayCollection instances. HTH, Ben --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Robin Burrer [EMAIL PROTECTED] wrote: Hi there, I have been playing around .net and flex for a while. Primarily I want to send value objects (consisting of strings, intergers and arrays of VOs) back and forth. I could not figure out how to do the following things though: 1. Sending arrays to a webservice works fine. However when I receive an array of the .net data type array flex creates and Array Collection data type. Sending arrays as array collections to a web service causes an error. That's really annoying when you try to keep the VOs consitent on both ends. What's the solution for this? 2. When I receive a complex data type from a .net web service flex creates an Object but when I try to cast this object to the dataType it represents I get a complier error, even though the received object has exactly the same properties as underlying VO. E.g. I get the following error code if I try to cast the result of a webservice call to my custom data Type TelephoneNumber. Note casting to an Object works fine. TypeError: Error #1034: Type Coercion failed: cannot convert mx.utils::[EMAIL PROTECTED] to webserviceClasses.TelephoneNumber. Any help is highly appreciated. Robin
RE: [flexcoders] Re: Flex and .net webservices
Darron's ObjectTranslator works perfectly - thanks for the tip! I still have to do some manual work though since I'm going to have nested VOs R From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Robin Burrer Sent: Tuesday, 12 December 2006 3:32 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: Flex and .net webservices Thanks Ben, I tried that. It still does not work ..:-(. I got rid of everything which could cause errors. ... Here's the code. I reckon this is as basic as it gets ... public function onMyResult(event:ResultEvent):void { // this works fine var myObject:Object = Object(event.result); // this causes an error (Error #1034: Type Coercion failed: cannot convert [EMAIL PROTECTED] to webserviceClasses.Employee.) var myEmployee:Employee = Employee(event.result); // does not work trace (myEmployee.employeeName); // does work trace (myObject.employeeName); } ]] /// the web service object /mx:Script mx:WebService showBusyCursor=true wsdl=http://localhost/ComplexDataTypeService/Service1.asmx?WSDL; id=myWebservice makeObjectsBindable=false mx:operation name=getDetails result={ onMyResult (event)} resultFormat=object/ /mx:WebService // the Employee object: public class Employee (AS) { public var employeeName:String; public var employeeID:int; } (c#) public class Employee { public string employeeName; public int employeeID; } Any ideas? Robin From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of ben.clinkinbeard Sent: Tuesday, 12 December 2006 2:02 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Flex and .net webservices Hi Robin, I have good news :), both of these issues should go away by setting a single attribute on your WebService object. Try setting makeObjectsBindable = false. This will cause Flex to deserialize your ws responses into regular Object and Array instances instead of ObjectProxy and ArrayCollection instances. HTH, Ben --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Robin Burrer [EMAIL PROTECTED] wrote: Hi there, I have been playing around .net and flex for a while. Primarily I want to send value objects (consisting of strings, intergers and arrays of VOs) back and forth. I could not figure out how to do the following things though: 1. Sending arrays to a webservice works fine. However when I receive an array of the .net data type array flex creates and Array Collection data type. Sending arrays as array collections to a web service causes an error. That's really annoying when you try to keep the VOs consitent on both ends. What's the solution for this? 2. When I receive a complex data type from a .net web service flex creates an Object but when I try to cast this object to the dataType it represents I get a complier error, even though the received object has exactly the same properties as underlying VO. E.g. I get the following error code if I try to cast the result of a webservice call to my custom data Type TelephoneNumber. Note casting to an Object works fine. TypeError: Error #1034: Type Coercion failed: cannot convert mx.utils::[EMAIL PROTECTED] to webserviceClasses.TelephoneNumber. Any help is highly appreciated. Robin
Re: [flexcoders] Re: Flex vs. .Net for RIA database apps; new to both
Actually flash remoting is part of Flex, when you use RemoteObject, you are using remoting.The thing is that currently (in F2B3), there are only server-side remoting gateway for Coldfusion (which support AMF3 - which also means, if you use RemoteObject in F2B3, your backend must be Coldfusion with updated adaptor) and FDS (which support Java only). So If you want to use Flex2 with .NET and remoting today, you can't use RemoteObject out of the box, you will have to maually create NetConnection instance and connect/call remote method.this is the product page from adobe: http://www.adobe.com/products/flashremoting/Fluorine is an open-source version of it, but just like the nature of most open source projects, stability and continuous development is always a consideration, when we have enough budget on the project, we will go with official product (at least we know whom to go to when things go wrong :-) ) On 6/12/06, michaellisten [EMAIL PROTECTED] wrote: What software is needed in order to use flash remoting? Just plain flash or is there some flash dev package? Are the terms for deploying simple or does one have to license per server etc? I've seen a couple of pages that ref ruby on rails too for the web services end of things. Not sure how practical it is. With Fluorine, I'll check it out, have seen it ref'd here, it runs on .net, and provides flash remoting? That does sound good. Was it created in part because it's less expensive to deploy than Flash remoting from Adobe? --- In flexcoders@yahoogroups.com, Jeremy Lu [EMAIL PROTECTED] wrote: one more note (to Tim's post) : aside from Web Service, you can also use flash remoting with .NET as the means of data transmission. we use both products from Macromedia (flash remoting for .NET) and Fluorine (open source flash remoting for .NET) all the time, just have to manually tweak NetConnection than that's it. ps. Flash Remoting uses binary AMF to send and receive native AS objects so it's a bit easier to handle large dataset. On 6/11/06, michaellisten [EMAIL PROTECTED] wrote: Tim, that's great feedback, and also very much what I was hoping to hear. Winforms over the web with data via remoting etc has been closest to what I have been wanting migrate to, whenever that time for the learning materializes for me. Flex seemed a worthy alternative but pricing seemed to put it out of reach till the major recent adjustment for Flex 2. The most attractive looking .net framework that uses winforms and remoting that I've looked at for RIA is DevForce aka Ideablade, but the pricing model for it resembles the early flex range, ie up there a bit. Encouraging, thanks! --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Tim Hoff TimHoff@ wrote: I agree completely with the assessment that Jeremy made concerning Flex's database suitability. Before Flex, I developed web applications primarily with ASP.NET. In my opinion, Flex is a much better choice for UI development. True, .Net includes all layers, but the main drawback is that pages are rendered by the server and sent to the browser one at a time. Flex, on the other hand, creates rich internet applications that only require data to be retrieved from the server. This gives you the best of both worlds, a desktop- like application with zero-deployment over the internet. I'm currently creating a Flex application that uses ASP.NET web services with a SQL Server back-end. In addition to being extremely easy to get work done, Flex makes the process of creating very complex user interfaces in a fraction of the time. In addition, if you also implement an MVC micro-architecture (like Cairngorm), you are able to quickly create very organized projects that are scalable and easily maintained. One other thought is that Flex can also be used as an alternative to .NET WinForms; without the associated DLL Hell and installation requirements. These are just my opinions, but I'm definitely sold on Flex for database driven web applications. Tim Hoff --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, michaellisten listensome@ wrote: Thanks Jeremy, I'd not seen the flex dev derby page. There are some pretty interesting apps there, a good exposure. Do you (or anyone) have any perspective on how flex compares with .net, re getting work done? .net in total includes in theory all layers including the webservice etc that one might use to handle interaction with the backend. With flex one uses java or rails or even .net. --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Jeremy Lu wade.lu@ wrote: well, Flex 2 is surely suitable for database oriented or data- centric application, you can check out the Flex Derby pages here:
Re: [flexcoders] Re: Flex vs. .Net for RIA database apps; new to both
one more note (to Tim's post) : aside from Web Service, you can also use flash remoting with .NET as the means of data transmission.we use both products from Macromedia (flash remoting for .NET) and Fluorine (open source flash remoting for .NET) all the time, just have to manually tweak NetConnection than that's it. ps. Flash Remoting uses binary AMF to send and receive native AS objects so it's a bit easier to handle large dataset.On 6/11/06, michaellisten [EMAIL PROTECTED] wrote: Tim, that's great feedback, and also very much what I was hoping to hear. Winforms over the web with data via remoting etc has been closest to what I have been wanting migrate to, whenever that time for the learning materializes for me. Flex seemed a worthy alternative but pricing seemed to put it out of reach till the major recent adjustment for Flex 2. The most attractive looking .net framework that uses winforms and remoting that I've looked at for RIA is DevForce aka Ideablade, but the pricing model for it resembles the early flex range, ie up there a bit. Encouraging, thanks! --- In flexcoders@yahoogroups.com, Tim Hoff [EMAIL PROTECTED] wrote: I agree completely with the assessment that Jeremy made concerning Flex's database suitability. Before Flex, I developed web applications primarily with ASP.NET. In my opinion, Flex is a much better choice for UI development. True, .Net includes all layers, but the main drawback is that pages are rendered by the server and sent to the browser one at a time. Flex, on the other hand, creates rich internet applications that only require data to be retrieved from the server. This gives you the best of both worlds, a desktop- like application with zero-deployment over the internet. I'm currently creating a Flex application that uses ASP.NET web services with a SQL Server back-end. In addition to being extremely easy to get work done, Flex makes the process of creating very complex user interfaces in a fraction of the time. In addition, if you also implement an MVC micro-architecture (like Cairngorm), you are able to quickly create very organized projects that are scalable and easily maintained. One other thought is that Flex can also be used as an alternative to .NET WinForms; without the associated DLL Hell and installation requirements. These are just my opinions, but I'm definitely sold on Flex for database driven web applications. Tim Hoff --- In flexcoders@yahoogroups.com, michaellisten listensome@ wrote: Thanks Jeremy, I'd not seen the flex dev derby page. There are some pretty interesting apps there, a good exposure. Do you (or anyone) have any perspective on how flex compares with .net, re getting work done? .net in total includes in theory all layers including the webservice etc that one might use to handle interaction with the backend. With flex one uses java or rails or even .net. --- In flexcoders@yahoogroups.com, Jeremy Lu wade.lu@ wrote: well, Flex 2 is surely suitable for database oriented or data- centric application, you can check out the Flex Derby pages here: http://labs.adobe.com/wiki/index.php/Showcase:Flex_Developer_Derby lot of applications are data-heavy and co-op with backend technology closely, this is never an issue. Judging from what you described (database-frontend, form-entry, CRUD stuff), Flex2 should serves you quite right, check out following topic in the livedoc/manual: -RPC in Data Service: this is for data connection with backend using HTTP Get/Post, Web Service, XML or Remoting. -FORMS: this is for creating user-input Forms, handling all the layout, required field, data validation and so on... -Validator: there are various built-in Validators (email, credit card...) to check user-input data before sending back to server. in my opinio, it's really a snap to build this kind of Form-Entry-CRUD-Stuff with Flex2 :-) Jeremy. On 6/10/06, michaellisten listensome@ wrote: But most flex example apps are less database oriented and are often showy shopping carts. Is flex going to be good for what I'm after? Most examples have little data entry. I posted here about flex/flashcomboboxes for data entry/selection and didn't get much in the way offeedback. I am most interested in the approach that is the most productive; helps the most with data binding, wysisyg designers, error handling, and so forth. I'm usually asked to create a lot of solid software in a minimal timeframe, so my priority here will be to choose software that simplifies the design/build cycle. __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: