Groups | Blog | Home
all groups > flash data integration > november 2006 >

flash data integration : .NET DataSet Results to Actionscipt


gordob
11/3/2006 5:11:50 PM
I am working with a web service that sends XML data back from the Web Service
as a .NET DataSet data type. In the output window the result looks pretty much
like XML data . I am using the Flash webserviceconnector, but I am not binding
the returned .Net DataSet data to any component. I would just like to access
the returned results with Actionscript.

I have tried things like:
_level0.GetZoneDangerRoseTrend.results.RoseColors <<<<????

I just want the returned RoseColor value: 444444444444222444444444 (see below)


Here is my results in the Output window:

Variable _level0.GetZoneDangerRoseTrend.results = [object #771, class
'Object'] {
schema:[object #772, class 'XMLNode'] {
<xs:schema id="Common" xmlns=""
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="Common" msdata:IsDataSet="true"
msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Table">
<xs:complexType>
<xs:sequence>
<xs:element name="RoseId" type="xs:int" minOccurs="0" />
<xs:element name="ZoneNumber" type="xs:unsignedByte"
minOccurs="0" />
<xs:element name="RoseColors" type="xs:string"
minOccurs="0" />
<xs:element name="RoseDays" type="xs:string" minOccurs="0"
/>
<xs:element name="CreatedDate" type="xs:dateTime"
minOccurs="0" />
<xs:element name="CreatedBy" type="xs:int" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
},
diffgram:[object #773, class 'XMLNode'] {
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<Common xmlns="">
<Table diffgr:id="Table1" msdata:rowOrder="0">
<RoseId>
63
</RoseId>
<ZoneNumber>
4
</ZoneNumber>
<RoseColors>
444444444444222444444444
</RoseColors>
<RoseDays>
20061022
</RoseDays>
<CreatedDate>
2006-10-22T09:27:30-06:00
</CreatedDate>
<CreatedBy>
gordob
11/7/2006 5:39:27 PM
In a continuing effort to get my web services problem solved, I have tried to
setup a dataset and datagrid components to recieve the XML result from my web
services connection. I can see the XML result, but the XML content doesn't seem
to load properly into my dataset component (as reported in my output text
below).

I am wondering if my dataset component is not setup correctly or if my XML
content is formatted improperly? Please Adobe reply!

Here is my output:
11/7 10:27:52 GetZoneDangerRoseTrend: Invoking
GetZoneDangerRoseTrend(["zone_4", "10/26/2006"])
11/7 10:27:53 GetZoneDangerRoseTrend: Data of property 'results' has changed.
true.
11/7 10:27:53 Executing binding from GetZoneDangerRoseTrend:results:- to
TrendDataSet:dataProvider:-
11/7 10:27:53 Assigning new value '{diffgram: <diffgr:diffgram
xmlns:msdata="urn:sche...' (Object) <<<<<????????? My .NET result starts here
11/7 10:27:53 TrendDataSet: Data of property 'selectedIndex' has changed.
true.
11/7 10:27:53 Executing binding from TrendDataSet:selectedIndex:- to
TrendDataGrid:selectedIndex:-
11/7 10:27:53 Assigning new value 'NaN' (Number)
gordob
11/8/2006 7:56:40 PM
It looks like .NET DataSets are not compatible with Flash 8's data components
(at least at Flash MX 2004 there was a problem .NET stuff). Does anyone know if
this is still true?

Are there any workarounds? I would like to continue using the
WebServicesConnector as it works with other .NET data types. Is returning an
array of objects from the Web Service still the only workaround for replacing
data sent back to Flash as a .NET DataSet?
l810c
11/8/2006 9:42:51 PM
Not sure about the .NET datasets.

This is how I do it. It kinda morphed along the way as I tried different
methods to get external data. I really don't like xml that much so I'm just
wrapping it up in and big string and parsing it on the Flash end. Here's some
Psuedo code:




C#
while (dataReader.Read())
{
dss.DesignStatusData +=
Convert.ToString(ds.RoseId_id) + '|' +
ds.ZoneNumber+ '|' +
ds.RoseColors+ '|' +
ds.RoseDays + '|' +
ds.CreatedDate + '|' +
ds.CreatedBy + '~' ;
}

return(dss.DesignStatusData);

Flash Class Code
// Web Service Listener Function for Design Class

public function ParseData(sDesigns:String){

var arDesigns:Array = sDesigns.split("~");
var i:Number;
for(i = 0; i < arDesigns.length - 1; i++) {
var arDesign:Array = arDesigns[i].split("|");
var j:Number;
for(j = 0; j < arDesign.length; j++) {
this.__DesignsArray[i] = new Design(arDesign[0], arDesign[1], arDesign[2],
arDesign[3], arDesign[4], arDesign[5], arDesign[6]);
}
}
}

And then in the main Flash app.
dgDesigns.dataProvider = Designs1.DesignsArray;
AddThis Social Bookmark Button