Try using the WSDL wizard in FB3. It works a treat!
 
~randy

   _____  

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Telmo Dias
Sent: Saturday, March 01, 2008 11:47 AM
To: [email protected]
Subject: [flexcoders] Flex Soap Object Arrays



Hi all,

First of all , I'm new to flex. Already bought a few books but none 
describes this issue in detail.

I'm having huge trouble accessing object arrays from SOAP. I'm using 
Flex Builder 3, Version: 3.0.190133, the last beta version.
I used the Import Web Services wizard to import 
HYPERLINK
"http://ws.marcocova.com/SOAP/af4.php?wsdl"http://ws.marcocova-.com/SOAP/-af
4.php?wsdl . My partner who writes the 
SOAP code, has tried several approaches. In the approaches before the 
current one, I couldn't even get a simple var, it would always come in 
as null. Now I can get simple vars like strings or numbers, but I'm 
unable to get Arrays.

Below is the code I'm using. At this moment when I debug I'm getting the 
error:

TypeError: Error #1009: Cannot access a property or method of a null 
object reference.
at WSDL8_AF4/processRe-sults()[F:-\Para_Novo_-CD\BACKUPS\-My 
Documents\Flex Builder 3\WSDL8_AF4\-src\WSDL8_-AF4.mxml:-32]
at flash.events:-:EventDispatcher-/dispatchEventFu-nction()
at flash.events:-:EventDispatcher-/dispatchEvent(-)
at 
com.marcocova:-:ExampleService/-_getPeopleByFirs-tLastName_-populate_-result
s()-[F:\Para_-Novo_CD\BACKUPS\-My 
Documents\Flex Builder
3\WSDL8_AF4\-src\com\marcocov-a\ExampleService-.as:147]
at flash.events:-:EventDispatcher-/dispatchEventFu-nction()
at flash.events:-:EventDispatcher-/dispatchEvent(-)
at 
com.marcocova:-:BaseExampleServ-ice/processResul-t()[F:\Para_-Novo_CD\BACKUP
S\-My 
Documents\Flex Builder 
3\WSDL8_AF4\-src\com\marcocov-a\BaseExampleSer-vice.as:207]
at 
mx.rpc::AsyncRespon-der/result(-)[E:\dev\-flex_3_beta3\-sdk\frameworks\-proj
ects\-rpc\src\mx\-rpc\AsyncRespond-er.as:73]
at 
mx.rpc::AsyncReques-t/acknowledge(-)[E:\dev\-flex_3_beta3\-sdk\frameworks\-p
rojects\-rpc\src\mx\-rpc\AsyncRequest-.as:81]
at 
DirectHTTPMessageRe-sponder/complete-Handler()-[E:\dev\flex_-3_beta3\sdk\-fr
ameworks\-projects\-rpc\src\mx\-messaging\-channels\-DirectHTTPChanne-l.as:3
87]
at flash.events:-:EventDispatcher-/dispatchEventFu-nction()
at flash.events:-:EventDispatcher-/dispatchEvent(-)
at flash.net::URLLoade-r/onComplete(-)

Can someone who understands this, please help me? I've been around this 
issue for one week without results... Already checked the posts on the 
list, since 14/11/2007.

Thanks in advance.

Telmo Dias

<?xml version="1.0" encoding="utf--8"?>
<mx:Application xmlns:mx="HYPERLINK
"http://www.adobe.com/2006/mxml"http://www.adobe.-com/2006/-mxml"; 
layout="absolute" initialize="-getResults(-)">
<mx:Script>
<![CDATA[
import com.marcocova.-*; //classes resultant from the wizard
import mx.collections.-ArrayCollection;
import mx.utils.ArrayUtil;

public function getResults()-:void{
var myService:ExampleSe-rvice = new ExampleService(-);
//* Step 2: for the desired operation add a result 
handler (a function that you have already defined previously) 

myService.addgetPeo-pleByFirstLastNa-meEventListener(-processResults)-;
//* Step 3: Call the operation as a method on the 
service. Pass the right values as arguments:
myService.getPeople-ByFirstLastName(-'*','*');

}

public function 
processResults(-res:GetPeopleByF-irstLastNameResu-ltEvent):-void{
trace(typeof res.result); //this outputs object
for (var x in res.result){
trace(typeof x);//doesn't even trace once
}
var arrRes:ArrayCollect-ion = res.result;
var arrPerson:Array = arrRes.toArray(-);
var pers:Person = Person(arrPerson[-0]);
trace(pers.firstNam-e); //nothing either
}
]]>
</mx:Script>
</mx:Application>

-- 
Telmo Dias <HYPERLINK "mailto:telmo%40xyle.pt"[EMAIL PROTECTED]>
XYLE [Xyledot Unipessoal Lda.]
R. Dr. Jose Martinho Simoes, 81
3260-421 Figueiro dos Vinhos - Leiria - Portugal
Website > www.xyle.pt
Tel/Phone > +351236551671
Tlm/Cell > +351918047464
____________-_________-_________-_________-_________-_

Nota de confidencialidade: Esta mensagem poderá conter informação
priveligiada e confidencial destinando-se exclusivamente ao destinatário da
mesma. Se não é o destinatário da presente comunicação, agradecemos que nos
informe e elimine a mensagem sem que a mesma seja divulgada, distribuida ou
copiada. Obrigado.



 


No virus found in this outgoing message.
Checked by AVG. 
Version: 7.5.516 / Virus Database: 269.21.2/1305 - Release Date: 2/29/2008
6:32 PM
 

Reply via email to