Re: [Flashcoders] Problem with parsing Webservice result correctly!
Might be that you need to explicitely indicate that ArrayOfString is an array (in XML terms: a sequence), i.e.: [...] ArrayOfString xsd:sequence stringfeild1/string stringfeild2/string /xsd:sequence /ArrayOfString [...] In our experience Flash can only successfully populate an Array if that sequence indication is there. HTH, stefan. On 9/4/06, Martin Baltzer Hennelund [EMAIL PROTECTED] wrote: Hi Thanks for your effort but I don't think that this could help all though its really interesting :-) Cheers Martin -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] På vegne af Merrill, Jason Sendt: 1. september 2006 13:50 Til: Flashcoders mailing list Emne: RE: [Flashcoders] Problem with parsing Webservice result correctly! Also, if this helps: http://www.sephiroth.it/tutorials/flashPHP/webServiceConnector/ Here is the WSDL is uses: http://www.xmethods.net/sd/2001/BabelFishService.wsdl Jason Merrill Bank of America Learning Organization Effectiveness - Technology Solutions -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Merrill, Jason Sent: Friday, September 01, 2006 7:38 AM To: Flashcoders mailing list Subject: RE: [Flashcoders] Problem with parsing Webservice result correctly! Be sure you wait for the result from the webservice and then try to access the data. I had the same problem in a recent thread (C# .NET and Webservices) and realized I needed to be sure I not only waited for the method to load, but also waited for the webservice method to finish. Was a duh moment for me. Then I could use the result as an object in Flash, even a very complex one: var thisEffect:String = Obj.Content.Topics[i].Images[n].Effect; So it definitely is supported and works, you may just not have waited long enough for the result? Jason Merrill Bank of America Learning Organization Effectiveness - Technology Solutions -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Martin Baltzer Hennelund Sent: Friday, September 01, 2006 5:27 AM To: Flashcoders mailing list Subject: [Flashcoders] Problem with parsing Webservice result correctly! Hi, Flash apparently fails to correctly parse a webservice function that returns a class/Object/Struct (Using Csharp to create the webservice). The following is returned from the service when hitting it in IE and is perfectly fine. ?xml version=1.0 encoding=utf-8 ? WsReply xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns=http://XXX/; typeArrayOfString/type ArrayOfString stringfeild1/string stringfeild2/string /ArrayOfString /WsReply The reply is equal to a class/Object with the name WsReply with two public fields one called type which is of type string and the second ArrayOfString which is an array of strings. But when the reply is parsed by Flash (mx.services.WebService) it looses the values inside the array even though the array is correctly populated with two fields (And it is a real array). When I do a for...in trace on the onResult object I get the following ArrayOfString: undefined,undefined type: ArrayOfString Anyone know why this is happening? When I read the Webservice documentation it seems like flash should support classes/Objects as a webservice return type??? Thanks a lot in advance Martin Baltzer Heres my very simple code for reference:) / import mx.services.Log; import mx.services.WebService; class dk.xxx.test.TestWS { public function TestWS() { var wsLog:Log = new Log(Log.NONE); wsLog.onLog = function(txt) { trace(wsLog: + txt); }; var myService:WebService = new WebService(http://.com/Service.asmx?WSDL;, wsLog); myService.onFault = function(fault) { // Your code here. var s: String = ; for (var x:String in fault){ s += \n + x +: + fault[x]; } trace(fault: + s); }; var serviceCall = myService.getTest(); serviceCall.onResult = function(result:Object) { var s: String = ; for (var x:String in result){ s += \n + x + : + result[x]; } trace(s); }; } } ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf
RE: [Flashcoders] Problem with parsing Webservice result correctly!
Be sure you wait for the result from the webservice and then try to access the data. I had the same problem in a recent thread (C# .NET and Webservices) and realized I needed to be sure I not only waited for the method to load, but also waited for the webservice method to finish. Was a duh moment for me. Then I could use the result as an object in Flash, even a very complex one: var thisEffect:String = Obj.Content.Topics[i].Images[n].Effect; So it definitely is supported and works, you may just not have waited long enough for the result? Jason Merrill Bank of America Learning Organization Effectiveness - Technology Solutions -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Martin Baltzer Hennelund Sent: Friday, September 01, 2006 5:27 AM To: Flashcoders mailing list Subject: [Flashcoders] Problem with parsing Webservice result correctly! Hi, Flash apparently fails to correctly parse a webservice function that returns a class/Object/Struct (Using Csharp to create the webservice). The following is returned from the service when hitting it in IE and is perfectly fine. ?xml version=1.0 encoding=utf-8 ? WsReply xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns=http://XXX/; typeArrayOfString/type ArrayOfString stringfeild1/string stringfeild2/string /ArrayOfString /WsReply The reply is equal to a class/Object with the name WsReply with two public fields one called type which is of type string and the second ArrayOfString which is an array of strings. But when the reply is parsed by Flash (mx.services.WebService) it looses the values inside the array even though the array is correctly populated with two fields (And it is a real array). When I do a for...in trace on the onResult object I get the following ArrayOfString: undefined,undefined type: ArrayOfString Anyone know why this is happening? When I read the Webservice documentation it seems like flash should support classes/Objects as a webservice return type??? Thanks a lot in advance Martin Baltzer Heres my very simple code for reference:) / import mx.services.Log; import mx.services.WebService; class dk.xxx.test.TestWS { public function TestWS() { var wsLog:Log = new Log(Log.NONE); wsLog.onLog = function(txt) { trace(wsLog: + txt); }; var myService:WebService = new WebService(http://.com/Service.asmx?WSDL;, wsLog); myService.onFault = function(fault) { // Your code here. var s: String = ; for (var x:String in fault){ s += \n + x +: + fault[x]; } trace(fault: + s); }; var serviceCall = myService.getTest(); serviceCall.onResult = function(result:Object) { var s: String = ; for (var x:String in result){ s += \n + x + : + result[x]; } trace(s); }; } } ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] Problem with parsing Webservice result correctly!
Also, if this helps: http://www.sephiroth.it/tutorials/flashPHP/webServiceConnector/ Here is the WSDL is uses: http://www.xmethods.net/sd/2001/BabelFishService.wsdl Jason Merrill Bank of America Learning Organization Effectiveness - Technology Solutions -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Merrill, Jason Sent: Friday, September 01, 2006 7:38 AM To: Flashcoders mailing list Subject: RE: [Flashcoders] Problem with parsing Webservice result correctly! Be sure you wait for the result from the webservice and then try to access the data. I had the same problem in a recent thread (C# .NET and Webservices) and realized I needed to be sure I not only waited for the method to load, but also waited for the webservice method to finish. Was a duh moment for me. Then I could use the result as an object in Flash, even a very complex one: var thisEffect:String = Obj.Content.Topics[i].Images[n].Effect; So it definitely is supported and works, you may just not have waited long enough for the result? Jason Merrill Bank of America Learning Organization Effectiveness - Technology Solutions -Original Message- From: [EMAIL PROTECTED] [mailto:flashcoders- [EMAIL PROTECTED] On Behalf Of Martin Baltzer Hennelund Sent: Friday, September 01, 2006 5:27 AM To: Flashcoders mailing list Subject: [Flashcoders] Problem with parsing Webservice result correctly! Hi, Flash apparently fails to correctly parse a webservice function that returns a class/Object/Struct (Using Csharp to create the webservice). The following is returned from the service when hitting it in IE and is perfectly fine. ?xml version=1.0 encoding=utf-8 ? WsReply xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns=http://XXX/; typeArrayOfString/type ArrayOfString stringfeild1/string stringfeild2/string /ArrayOfString /WsReply The reply is equal to a class/Object with the name WsReply with two public fields one called type which is of type string and the second ArrayOfString which is an array of strings. But when the reply is parsed by Flash (mx.services.WebService) it looses the values inside the array even though the array is correctly populated with two fields (And it is a real array). When I do a for...in trace on the onResult object I get the following ArrayOfString: undefined,undefined type: ArrayOfString Anyone know why this is happening? When I read the Webservice documentation it seems like flash should support classes/Objects as a webservice return type??? Thanks a lot in advance Martin Baltzer Heres my very simple code for reference:) / import mx.services.Log; import mx.services.WebService; class dk.xxx.test.TestWS { public function TestWS() { var wsLog:Log = new Log(Log.NONE); wsLog.onLog = function(txt) { trace(wsLog: + txt); }; var myService:WebService = new WebService(http://.com/Service.asmx?WSDL;, wsLog); myService.onFault = function(fault) { // Your code here. var s: String = ; for (var x:String in fault){ s += \n + x +: + fault[x]; } trace(fault: + s); }; var serviceCall = myService.getTest(); serviceCall.onResult = function(result:Object) { var s: String = ; for (var x:String in result){ s += \n + x + : + result[x]; } trace(s); }; } } ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com