Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

fred.rage

Erro com WebService quando chamado na função creationComplete

Recommended Posts

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

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

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

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.