Tenta asssim
Alert.show( ObjectUtil.toString( resultObj ) );
*Eduardo Kraus*
Desenvolvedor
[email protected]
http://blog.mxml.com.br
http://twitter.com/EduardoKraus
2009/6/8 Ph.E <[email protected]>
>
> Saudações Amigos,
>
>
> Bem, bem.. Amigos, ainda continuo com o problema. Depois de
> alguns testes, e de quebrar a cabeça mais um pouco consegui isto:
>
> Código Flex:
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
> verticalAlign="middle" x="-43" y="12">
>
> <!--
> Objeto requerido para instanciar o HTTPService. Não deletar.
> -->
>
> <mx:HTTPService>
> <mx:request xmlns="*">
> </mx:request>
> </mx:HTTPService>
>
> <mx:Panel width="444" height="224" layout="absolute">
>
> <mx:Script>
>
> <![CDATA[
> import mx.controls.Alert;
> import mx.rpc.events.ResultEvent;
> import mx.rpc.events.FaultEvent;
>
> private function logar():void {
> if ((editLogin.text == "")||(editSenha.text == "")){
> return;
> }
>
> var objHTTP : HTTPService = new HTTPService();
> objHTTP.useProxy = false;
> objHTTP.showBusyCursor = true;
> objHTTP.resultFormat = "e4x";
> objHTTP.addEventListener(FaultEvent.FAULT, exibeErro);
> objHTTP.addEventListener(ResultEvent.RESULT,
> exibeResposta);
> objHTTP.url = "http://localhost:57772/csp/webservicebi/
> WebServiceBI.Usuario.cls?soap_method=Test";
> objHTTP.send();
> }
>
> private function exibeResposta(response:ResultEvent):void {
> Alert.show(response.message.body.toString());
> }
>
> private function exibeErro(event:FaultEvent):void {
> Alert.show(event.fault.message, ".: Erro - Erro ao
> Logar no Aplicativo :.");
> }
>
> ]]>
>
> </mx:Script>
>
> <mx:Button label="Logar" bottom="10" right="95"
> id="btnAcessar"
> enabled="true" click="logar();"/>
> <mx:Button label="Cancelar" bottom="10" right="12"
> id="btnCancelar"
> enabled="true"/>
> <mx:Image source="../Imagens/safe_into.png" width="129"
> top="22"
> bottom="25" left="10"/>
> <mx:Label x="188.5" y="47" text="Usuário"/>
> <mx:Label x="192" y="73" text="Senha"/>
> <mx:TextInput x="237" y="45" id="editLogin" editable="true"
> enabled="true"/>
> <mx:TextInput x="237" y="71" displayAsPassword="true"
> maxChars="10"
> id="editSenha" editable="true" enabled="true" width="160"/>
> </mx:Panel>
> </mx:Application>
>
>
>
>
> O Alert esta me exibindo o XML puramente. Da seguinte forma:
>
> <?xml version="1.0" encoding="UTF-8" ?>
>
> <SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/
> envelope/ <http://schemas.xmlsoap.org/soap/%0Aenvelope/>' xmlns:xsi='
> http://www.w3.org/2001/XMLSchema-instance'
> xmlns:s='http://www.w3.org/2001/XMLSchema'>
>
> <SOAP-ENV:Body>
>
> <TestResponse><TestResult>'Hello Word'</TestResult></TestResponse> </
> SOAP-ENV:Body>
>
> </SOAP-ENV:Envelope>
>
>
>
>
> Agora, me falta conseguir pegar o valor da TAG "<TestResult>"
> especifica. Alguem por favor sabe me dizer como eu faço isso?
> Já estou a um bom tempo tentando e nada..
> Obrigado
>
>
> On 5 jun, 17:57, "Ph.E" <[email protected]> wrote:
> > Estou querendo primeiro aprender o básico da conexão, para depois
> > utilizar algum "carinha" no meio.. como o BlazeDS.
> > Estou tentado a utilizar o BlazeDS, pois dizem que é muito bom, e
> > senão me angano o AMF é pago, ou tem alguma história assim..
> > Bom, já tive uma palestra com Igor Costa sobre essas tecnologias, mas
> > não me lembro muito bem..
> >
> > Você disse, que não utiliza o HTTPService. Existe outra forma de
> > conexão com WebServices?
> >
> > Abraço
> >
> > On 5 jun, 17:53, André Caetano <[email protected]> wrote:
> >
> >
> >
> > > Cara tenta isso:
> >
> > > private function exibeResposta(response:ResultEvent):void {
> > > var dados:ArrayColection = new ArrayColection(response as
> > > Array);
> > > Alert.show(dados[0].seuAtributo);
> > > }
> >
> > > geralmente isso se usa quando o evento retorna um list
> >
> > > para xml é um pouco diferente, como eu nuca uso httpServices nao sou
> mais
> > > indicado para o seu problema.
> >
> > > E aproveitando tente usar alguma integração que utilize amf como
> amfphp,
> > > zendAmf ,
> > > ou java blazeds, ou Ruby rubyamf
> >
> > > André Deividi Caetano
> >
>
--~--~---------~--~----~------------~-------~--~----~
Você recebeu esta mensagem porque está inscrito na lista "flexdev"
Para enviar uma mensagem, envie um e-mail para [email protected]
Para sair da lista, envie um email em branco para
[email protected]
Mais opções estão disponíveis em http://groups.google.com/group/flexdev
-~----------~----~----~----~------~----~------~--~---