# Parsing web services arrays

**URL:** https://forum.kirupa.com/t/parsing-web-services-arrays/290924
**Category:** Uncategorized
**Created:** [June 22, 2009, 10:53am UTC](https://forum.kirupa.com/t/parsing-web-services-arrays/290924 "2009-06-22T10:53:20Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Ashlev](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@Ashlev](https://forum.kirupa.com/u/Ashlev)
#### Post date: [June 22, 2009, 10:53am UTC](https://forum.kirupa.com/t/parsing-web-services-arrays/290924/1 "2009-06-22T10:53:20Z")

</div>

Hi all

Im new to web services and have a (probably very easy) problem when it comes to displaying results. I am able to get results in strings to show, but as soon as I try and get results that come through an array I am struggling to find the correct syntax to show the results. The web service is a dictionary, and I am sending it a predefined word and trying to get a definition back from it.

The schma is as shown:

\<-- results:WordDefinition (object)  
\<-- Definitions:ArrayOfDefinition (array)  
\<-- [n]: Definition (object)  
\<-- WordDefinition:String (string)

my current code is:

import mx.services.\*;

result\_btn.onPress = function() {

var stockservice = new WebService(“[http://services.aonaware.com/DictService/DictService.asmx?WSDL](http://services.aonaware.com/DictService/DictService.asmx?WSDL)”,stockServiceLog);

stockResultObj = stockservice.Define(“fair”);  
stockservice.onLoad = trace(“loading”);

stockResultObj.onResult = function(result) {

trace("word: "+result.Definitions.WordDefinition);

};  
stockResultObj.onFault = function(fault) {

trace(fault.faultCode+","+fault.faultstring);  
};  
};  
stockServiceLog = new Log(Log.VERBOSE);  
stockServiceLog.onLog = function(txt) {  
trace(txt);  
}

For "trace("word: “+result.Definitions.WordDefinition);” I have tried various variations of Definitions[n].WordDefinition, Definitions[“fair”].WordDefinition, Definitions[fair].WordDefinition  
But all produce the result of word: undefined.

Would really like the result to be placed into a variable/array.

Cheers Ash
