all groups > flash data integration > november 2006 >
You're in the

flash data integration

group:

Deserialize an array of objects from a web service


Deserialize an array of objects from a web service Yourself
11/5/2006 12:00:00 AM
flash data integration:
Hi, I'm calling a webservice method which returns an array of objects (let's
say classes called MyClass).

I now want to define a class in actionscript called MyClass which matches
the properties of the class defined in the web service (written in .NET),
call the webservice method, and then deserialize the result in actionscript
into an array of type MyClass.

The code I have so far is:

import mx.services.WebService;
import mx.services.Log;

var mylog:Log = new Log(Log.DEBUG);
myLog.onLog = function(txt) {
trace(txt);
};

var ws:WebService = new WebService(wsc.WSDLURL);

ws.onLoad = function(wsdl) {
MyPendingCallObject =
ws.CallTheWebServiceMethodWhichReturnsAnArrayOfMyClasses();
MyPendingCallObject.onResult = function(result)
{
trace(result);
// HOW CAN I DESERIALIZE the result parameter into an Array of
MyClass ???
}
MyPendingCallObject.onFault = function(fault)
{
trace('FAULT! ' + fault.faultCode + "," + fault.faultstring);
}
};

// If the WSDL fails to load the onFault event is fired.
ws.onFault = function(fault) {
trace(fault.faultstring);
};

TIA




Re: Deserialize an array of objects from a web service flegoff
1/16/2007 2:52:02 PM
Hi,

I posted a similar problem some time ago :

http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=29
4&threadid=1221565&enterthread=y

Do you find any solution to your problem ?

Fabrice
AddThis Social Bookmark Button