fred.rage 0 Denunciar post Postado Janeiro 30, 2008 Olá pessoal, estou com uma dúvida com WebServices em relação a função creationComplete. Se eu chamo o WebService de outra forma, seja por um click em um botão ou em um menu, o WebService é chamado normalmente e nenhum problema ocorre. Tanto que tenho uma tela de login e senha que esta funcionando normalmente com WebService e beck end em Java. Mas, quando tento chamar a mesma função pelo método creationComplete da tag Application, o erro abaixo é retornado: [WSDLError faultString=Element http://servicos.empresa.com.br/:getMenuDeUsuario 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::invokePending\ Call() at mx.rpc.soap::Operation/http://www.adobe.com/2006/flex/mx/internal::invokeAllPend\ ing() at mx.rpc.soap::WebService/::unEnqueueCalls() at mx.rpc.soap::WebService/http://www.adobe.com/2006/flex/mx/internal::wsdlHandler(\ ) at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio\ n() at flash.events::EventDispatcher/dispatchEvent() at mx.rpc.soap::WSDLParser/dispatchEvent() at mx.rpc.soap::WSDLParser/::parseCompleted() at mx.rpc.soap::WSDLParser/http://www.adobe.com/2006/flex/mx/internal::httpResultHa\ ndler() at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio\ n() at flash.events::EventDispatcher/dispatchEvent() at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcE\ vent() at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandle\ r() at mx.rpc::Responder/result() at mx.rpc::AsyncRequest/acknowledge() at ::DirectHTTPMessageResponder/completeHandler() at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio\ n() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/flash.net:URLLoader::onComplete() A tag Application esta assim: <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" fontFamily="Verdana" creationComplete="initApp()"> A função initApp esta assim: private function initApp():void { ws.getMenuDeUsuario.send(); } Alguém sabe fazer se é possível chamar o WebService diretamente na criação da aplicação como estou querendo? Só lembrando que seu eu chamar em qualquer outro evento, funciona. Att, Fred Compartilhar este post Link para o post Compartilhar em outros sites
Eder Fortunato 15 Denunciar post Postado Janeiro 30, 2008 testa jogar no applicationComplete, ele é executado depois do creationComplete dá uma lida AQUI para ver a ordem em que tudo executa []´s Compartilhar este post Link para o post Compartilhar em outros sites
fred.rage 0 Denunciar post Postado Janeiro 30, 2008 Cara, continua ocorrendo o mesmo erro. Na função applicationComplete, estou chamando uma função para consumir o web service: <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" fontFamily="Verdana" creationComplete="initApp()" applicationComplete="getPerfilDeUsuario()"> E na função getPerfilDeUsuario eu faço: private function getPerfilDeUsuario():void { ws.getPerfilDeUsuario.send(); } A tag do WebService é essa: <mx:WebService id="ws" wsdl="http://localhost:8080/projeto/WSUsuario?wsdl" useProxy="false" showBusyCursor="true" result="resultHandler(event);"> <mx:operation name="getPerfilDeUsuario" /> </mx:WebService> Compartilhar este post Link para o post Compartilhar em outros sites
Eder Fortunato 15 Denunciar post Postado Janeiro 30, 2008 mesmo testando assim? <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" fontFamily="Verdana" applicationComplete="initApp(); getPerfilDeUsuario()"> ou então jogando o getPerfilDeUsuario, dentro da função initApp []´s Compartilhar este post Link para o post Compartilhar em outros sites
fred.rage 0 Denunciar post Postado Janeiro 30, 2008 Assim também não funciona. O que me deixa intrigado é que se eu colocar o mesmo método no evento click de um botão, o web service é consumido sem nenhum problema. Att, Fred Compartilhar este post Link para o post Compartilhar em outros sites
fred.rage 0 Denunciar post Postado Janeiro 30, 2008 Será que isso poder ser algum bug do plugin para o Eclipse ou do próprio sdk do Flex 2.01? Compartilhar este post Link para o post Compartilhar em outros sites
fred.rage 0 Denunciar post Postado Janeiro 31, 2008 Pessoal, creio que isso realmente seja um bug da versão 2.01 do Flex, pois instalei a versão 3 e funcionou de primeira. Valeu! Compartilhar este post Link para o post Compartilhar em outros sites