Olha, na hora que fui implementar esse esquema de cep aqui, iria utilizar o
webservices, porém, visto que não é muito confiável optei por ter uma base
de ceps aqui mesmo e fazer a consulta na minha base de dados e ir
atualizando a base de vez enquando...

Cuidado se for implementar em algo importante...

O principal motivo para eu ter desistido do webservices é que tenho um
servidor linux atrás de um firewall, então, eu tinha que passar pelo
firewall para receber a resposta do webservices, o problema é que tem
autenticação e tava me dando a maior dor de cabeça, fui direto para essa
solução...


Valeu!


On 23/10/2007, Ricardo Araujo <[EMAIL PROTECTED]> wrote:
>
>
> E isso que da raiva não da erro!!!! simplesmente nao aparece nos
> textbox
>
> On 22 out, 22:53, Ricardo Ramires <[EMAIL PROTECTED]> wrote:
> > Humm, aqui funcionou... que estranho...
> >
> > que mensagem de erro que dá ?
> >
> > On 22 out, 21:01, "Ricardo Araujo" <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > Chara, mandou bem no codigo...
> >
> > > mas no meu nao funcionou =(
> > > tanto o seu codigo como o meu com aquele detalhe arrumado nao
> funcionaram.
> >
> > > mais alguem nao funcionou?
> >
> > > Quanto ao webservice, outros serviços eu nao sei, acredito que ainda
> nao...
> > > esse web service é de um camarada lá da lista CF-BRASIL e pelo jeito
> esse
> > > webservice veio pra ficar, é foda esses outros que vc pega e depois de
> 2
> > > meses eles desativam da a maior dor de cabeça, mas vou sugerir para
> ele esse
> > > novo metodo.
> >
> > > On 10/22/07, Ricardo Ramires <[EMAIL PROTECTED]> wrote:
> >
> > > > Opa chará, acho que vc só esqueceu de incrementar colocar cep
> >
> > > > tava assim
> > > > CEPService1.getCEP.lastResult.estadoNome
> > > > fica assim no seu caso
> > > > CEPService1.getCEP.lastResult.cep.estadoNome
> >
> > > > Aqui segue o codigo funcionando, mudei algumas coisinhas...
> >
> > > > <?xml version="1.0" encoding="utf-8"?>
> > > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
> > > > layout="absolute"
> > > > creationComplete="init()">
> >
> > > >        <mx:Script>
> > > >        <![CDATA[
> > > >                import mx.rpc.AbstractOperation;
> >
> > > >                import mx.rpc.events.ResultEvent;
> > > >                import mx.rpc.events.FaultEvent;
> > > >                import mx.rpc.soap.LoadEvent;
> > > >                import mx.rpc.soap.WebService;
> >
> > > >                //
> > > > ------------------------------------------------------------------
> > > >                        //
> > > >                        // declaracao das propriedades
> > > >                        //
> > > >                        //
> > > > ------------------------------------------------------------------
> >
> > > >            private var ws:WebService;
> >
> > > >            [Bindable] private var enderecoLogradouro:String;
> > > >            [Bindable] private var bairro:String;
> > > >            [Bindable] private var estadoNome:String;
> > > >            [Bindable] private var estadoSigla:String;
> > > >            [Bindable] private var cidade:String;
> >
> > > >            //
> > > > ------------------------------------------------------------------
> > > >                        //
> > > >                        // metodos  privados
> > > >                        //
> > > >                        //
> > > > ------------------------------------------------------------------
> >
> > > >            private function init():void
> > > >            {
> > > >                ws = new WebService();
> >
> > > >                // listeners
> > > >                                ws.addEventListener(LoadEvent.LOAD,
> > > > wsLoadHandler);
> > > >                                ws.addEventListener(FaultEvent.FAULT,
> > > > wsFaultHandler);
> > > >                                ws.addEventListener(
> ResultEvent.RESULT,
> > > > wsResultHandler)
> >
> > > >                                // chamando o descritor
> > > >                                ws.wsdl = "
> > > >http://cep.zsolutions.com.br/cep.cfc?wsdl";;
> > > >                                ws.loadWSDL();
> > > >                                ws.useProxy = false;
> > > >            }
> >
> > > >            private function wsLoadHandler(event:LoadEvent):void
> > > >            {
> > > >                trace("wsLoadHandler: descritor carregado !");
> >
> > > >                buscar_btn.enabled = true;
> > > >            }
> >
> > > >            private function wsFaultHandler(event:FaultEvent):void
> > > >            {
> > > >                trace("wsFaultHandler: " + event.fault.faultString);
> > > >            }
> >
> > > >            private function wsResultHandler(event:ResultEvent):void
> > > >            {
> > > >                trace("wsResultHandler: ");
> >
> > > >                enderecoLogradouro =
> event.result.cep.enderecoLogradouro;
> > > >                bairro = event.result.cep.bairro;
> > > >                estadoNome = event.result.cep.estadoNome;
> > > >                estadoSigla = event.result.cep.estadoSigla;
> > > >                cidade = event.result.cep.cidade;
> > > >            }
> >
> > > >            private function buscarHandler(event:MouseEvent):void
> > > >            {
> > > >                // aqui da pra vc trocar de servico se o seu
> webservise
> > > > tiver mais de 1
> > > >                var operation:AbstractOperation = ws['getCEP'];
> >
> > > >                operation.send(txtCEP.text, "xml ");
> > > >            }
> >
> > > >        ]]>
> > > >    </mx:Script>
> >
> > > >        <mx:Panel y="71" width="397" height="223" layout="absolute"
> > > > title="Consulta CEP" toolTip="By zSolutions -www.zsolutions.com.br"
> > > > horizontalCenter="0.5">
> > > >                <mx:TextInput x="75" y="10" width="101" id="txtCEP"
> > > > maxChars="8"
> > > > restrict="0-9" />
> > > >                <mx:Label x="10" y="12" text="CEP:"/>
> > > >                <mx:Button x="184" y="10" label="Buscar"
> > > > click="buscarHandler(event)" enabled="false" id="buscar_btn"/>
> > > >                <mx:Label x="6" y="83" text="Endereço"/>
> > > >                <mx:TextInput x="65" y="81" width="302"
> > > > text="{enderecoLogradouro}"/>
> > > >                <mx:Label x="6" y="109" text="Bairro" />
> > > >               <mx:TextInput x="65" y="107" id="txtBairro"
> > > > text="{bairro}" width="142"/>
> > > >                <mx:Label x="6" y="135" text="Estado" />
> > > >                <mx:TextInput x="65" y="133"
> > > > text="{estadoNome}" width="142"/>
> > > >                <mx:Label x="215" y="135" text="UF" />
> > > >                <mx:TextInput x="269" y="133" width="52"
> > > > text="{estadoSigla}"/>
> > > >                <mx:Label x="215" y="109" text="Cidade"/>
> > > >                <mx:TextInput x="269" y="107" text="{cidade}"
> > > > id="txtCidade" width="98"/>
> > > >        </mx:Panel>
> > > > </mx:Application>
> >
> > > > On 22 out, 10:05, Ricardo Araujo <[EMAIL PROTECTED]> wrote:
> > > > > Bom dia, flexDevelopers
> > > > > Estou querendo montar uma interface para consumir um webService de
> > > > > CEP,
> > > > > Consigo Conectar, consigo Ver o Retorno, POREM nao consigo
> mostra-lo,
> > > > > alguem pode me ajudar, não da erro nenhum, segue o codigo bem
> simples
> > > > > Valeu...
> >
> > > > > <?xml version="1.0" encoding="utf-8"?>
> > > > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
> > > > > layout="absolute" >
> > > > > <mx:Script>
> > > > >         <![CDATA[
> > > > >             import mx.controls.Alert;
> > > > >             import mx.rpc.events.FaultEvent;
> > > > >             import mx.rpc.events.ResultEvent;
> >
> > > > >                         private function
> > > > FaultHandler(event:FaultEvent):void
> > > > >             {
> >
> > > > >                 Alert.show(event.fault.message, "Não foi possivel
> > > > > conectar no Web Service");
> > > > >             }
> > > > >             private function resultHandler(event:ResultEvent):void
> > > > >             {
> > > > >                 //Alert.show(String(event.result.cep.bairro),"");
> > > > >                 Alert.show(String(CEPService1.getCEP.lastResult),
> > > > > "");
> > > > >             }
> > > > >                         ]]>
> > > > >     </mx:Script>
> >
> > > > > <mx:WebService
> > > > >         wsdl="http://cep.zsolutions.com.br/cep.cfc?wsdl";
> > > > >         useProxy="false"
> > > > >         id="CEPService1"
> > > > >         fault="FaultHandler(event);"
> > > > >         showBusyCursor="true"
> > > > >         result="resultHandler(event);">
> > > > >         <mx:operation name="getCEP">
> > > > >                 <mx:request>
> > > > >                         <CEP>
> > > > >                                 {txtCEP.text}
> > > > >                         </CEP>
> > > > >                         <tipoRetorno>
> > > > >                                 xml
> > > > >                         </tipoRetorno>
> > > > >                 </mx:request>
> > > > >         </mx:operation>
> > > > > </mx:WebService>
> >
> > > > >         <mx:Panel y="71" width="397" height="223"
> layout="absolute"
> > > > > title="Consulta CEP" toolTip="By zSolutions -www.zsolutions.com.br
> "
> > > > > horizontalCenter="0.5">
> > > > >                 <mx:TextInput x="75" y="10" width="101"
> id="txtCEP"
> > > > maxChars="8"
> > > > > restrict="0-9" />
> > > > >                 <mx:Label x="10" y="12" text="CEP:"/>
> > > > >                 <mx:Button x="184" y="10" label="Buscar"
> > > > > click="CEPService1.getCEP.send()"/>
> > > > >                 <mx:Label x="6" y="83" text="Endereço"/>
> > > > >                 <mx:TextInput x="65" y="81" width="302"
> > > > > text="{CEPService1.getCEP.lastResult.enderecoLogradouro}"/>
> > > > >                 <mx:Label x="6" y="109" text="Bairro" />
> > > > >                 <mx:TextInput x="65" y="107" id="txtBairro"
> > > > > text="{CEPService1.getCEP.lastResult.bairro}" width="142"/>
> > > > >                 <mx:Label x="6" y="135" text="Estado" />
> > > > >                 <mx:TextInput x="65" y="133"
> > > > > text="{CEPService1.getCEP.lastResult.estadoNome}" width="142"/>
> > > > >                 <mx:Label x="215" y="135" text="UF" />
> > > > >                 <mx:TextInput x="269" y="133" width="52"
> > > > > text="{CEPService1.getCEP.lastResult.estadoSigla}"/>
> > > > >                 <mx:Label x="215" y="109" text="Cidade"/>
> > > > >                 <mx:TextInput x="269" y="107" id="txtCidade"
> > > > width="98"/>
> > > > >         </mx:Panel>
> > > > > </mx:Application>
> >
> > > > No meu blog tem + um exemplo se ineressar:
> >
> > > >http://www.rlog.com.br/index.asp?cod_news=7&cod_type=2
> >
> > > > Esse webservice tem + servicos ??? tipo seria interessante vc passar
> a
> > > > rua e ele retornar o cep, né que nem esse aqui que tem obterCEP e
> > > > obterLogradouro:
> >
> > > >http://www.byjg.com.br/xmlnuke-php/webservice.php/ws/cep?WSDL
> >
> > > > []'s
> >
> > > > Ricardo
> >
> > > --
> > > Aquele Abraço,
> > > Ricardo Araujo
> > > (11) 3462-2607
> > > (11) 3554-1544- Ocultar texto entre aspas -
> >
> > - Mostrar texto entre aspas -
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
Você recebeu esta mensagem porque está inscrito na lista "flexdev"
Para enviar uma mensagem, envie um e-mail para flexdev@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Responder a