RE: [flexcoders] WSDLError:Element not resolvable = LoadEvent doesn't imply service ready

2006-08-08 Thread Franck de Bruijn












Hi Kaleb,



I always expected the web service to be
ready after the load event completed. Probably its a matter of
milliseconds. I never encountered your problem before, since I dont
automatically call web services after loading. So far, my webservices are only
invoked behind a button.



But sooner or later I probably will, since
I will want to push master data from the server into the application (like a
country table or something like that) directly after startup.



So, this does not sound good ...



I expect that your workaround is the only
solution.



Cheers,

Franck















From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of kaleb_pederson
Sent: Tuesday, August 08, 2006
1:38 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders]
WSDLError:Element not resolvable = LoadEvent doesn't imply service ready











I have been struggling with the Element not
resolvable error today 
in some of my unit tests using FlexUnit. As far as I can tell, the 
LoadEvent doesn't imply that the service is ready. If I put a timer 
in and wait 1 second after the load event to make my service call, 
everything works correctly. If I don't wait 1 second, however, then 
I receive the Element not resolvable error. This appears to be a 
bug in the WebService class.

Here's my sample code:

import mx.rpc.soap.WebService;
import flash.events.Event;
import mx.rpc.events.ResultEvent;
import mx.rpc.soap.LoadEvent;
import flash.utils.Timer;
import flash.events.TimerEvent;

public class SoapDemoTest {

public function testListVocabularies():void {
trace('testListVocabularies');
ws = new mx.rpc.soap.WebService();
ws.addEventListener(LoadEvent.LOAD, onLoadCompleted);
ws.loadWSDL(http://192.168.1.1:8080/myserv/myserv?wsdl);
}

private function onLoadCompleted(evt:LoadEvent):void {
trace('onLoadCompleted');

// if I just call ws.listVocabularies, I receive the
// Cannot Resolve Element error.
ws.addEventListener(ResultEvent.RESULT,onResultReceived);
ws.listVocabularies(5,true);

/*
// if I use this timer instead of the above, everything works
var timer:Timer = new Timer(1000, 1);
timer.addEventListener(
TimerEvent.TIMER_COMPLETE,
onTimerComplete
);
timer.start();
*/
}

private function onTimerComplete(evt:TimerEvent):void {
trace(onTimerComplete);
ws.addEventListener(ResultEvent.RESULT,onResultReceived);
ws.listVocabularies(5,true);
} 

private function onResultReceived(evt:ResultEvent):void {
trace(onResultReceived);
trace(result:  + evt.result.toString());
}

}

To test, simply fire testListVocabularies() in a CreationComplete 
event handler.

Can anyone else confirm this? By the messages, it sounds like the 
exact same thing that a number of people are running into.

Thanks for the help.

--Kaleb






__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  






__,_._,___






[flexcoders] WSDLError:Element not resolvable

2006-07-27 Thread flexava
I ran into a strange problem when I was trying to call a web
service.Here's the source:
?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=vertical
mx:Script
![CDATA[
import mx.rpc.events.FaultEvent;
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
import 
com.adobe.cairngorm.control.CairngormEventDispatcher;
import com.ceno.umc.control.LoginEvent;

private function onResult(event : ResultEvent) : void
{
Alert.show(event.result.toString(),result);
}

private function onFault(event : FaultEvent) : void
{

Alert.show(event.fault.faultString,faultString);
}
]]
/mx:Script
mx:WebService id=aService service=umc/umc/auth
port=umc/umc/authHttpPort 
wsdl=http://localhost:8008/ws/services/umc/umc/auth?wsdl;
showBusyCursor=true
result=onResult(event) fault=onFault(event) 
  mx:operation name=login resultFormat=e4x
mx:request
req
subject
admin
/subject
username
admin
/username
password
admin
/password
/req
/mx:request
  /mx:operation 
/mx:WebService
mx:Button label=Login click=aService.login.send()/
/mx:Application
when I clicked the login button it first showed me an error dialog saying:
[WSDLError faultString=Element http://cmd.umc.ceno.com:loginResponse
not resolvable faultCode=WSDL.BadElement faultDetail=null]
at
mx.rpc.soap::WSDLParser/http://www.adobe.com/2006/flex/mx/internal::parseMessage()
at mx.rpc.soap::WSDLOperation/parseMessages()
at
mx.rpc.soap::Operation/http://www.adobe.com/2006/flex/mx/internal::invokePendingCall()
at mx.rpc.soap::Operation/send()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.rpc.soap.mxml::Operation/send()
at WSTest/___Button1_click()
then I clicked the login button again,eveything worked.Any idea? Thanks.





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/