Hi, Hmm... I thought I was sure of that since I'm getting the reply back in my serviceCall.onResult() method.
Are you saying that I can't be sure that data is loaded correctly at that time? Actually the problem is being narrowed down to the "ArrayOfString" return type. I receive undefined on all the array positions and as I see it it is out of my hands...Maybe this I srealted to .NET since a former project runs just fine Thanks a lot Martin -----Oprindelig meddelelse----- Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] På vegne af Merrill, Jason Sendt: 1. september 2006 13:38 Til: Flashcoders mailing list Emne: 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/"> >> >> <type>ArrayOfString</type> >> <ArrayOfString> >> <string>feild1</string> >> <string>feild2</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://XXXX.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