Fórum Consulta CEP WebService FLEX #474311
27/03/2014
0
meu httpservice:
<mx:HTTPService id="buscaCep" result="cepResultHandler(event)"
method="GET" showBusyCursor="true" resultFormat="e4x"/>
meu metodo de consulta e retorno :
public function consultaCep():void{
buscaCep.url = "https://www.devmedia.com.br/devware/cep/service/?cep="+txCep.text+"&chave=XXXXXXXXXX&formato=xml";
buscaCep.send();
}
private function cepResultHandler(event:ResultEvent):void{
var resultXML:XMLList = new XMLList(new XML(event.result));
if(resultXML.resultado_txt == 'sucesso'){
txLogradouro.text = new String(resultXML.logradouro);
txBai.text = new String(resultXML.bairro);
txNomCid.text = new String(resultXML.cidade);
txUf.text = new String(resultXML.uf);
}
}
esse mesmo método mas POST na republica digital eu consigo, mas está desatualizado...
buscaCep.url = "http://cep.republicavirtual.com.br/web_cep.php?cep=" + txCep.text;
Robson Morais
Curtir tópico
+ 0Posts
01/04/2014
Robson Morais
[RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTP"]*** Violação da área de segurança *** Conexão com https://www.devmedia.com.br/devware/cep/service/?cep=25935-848&chave=397DHD990I&formato=xml interrompida – não permitida de http://localhost/AppInnovation/index.swf at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\dev\4.y\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:345] at mx.rpc::Responder/fault()[E:\dev\4.y\frameworks\projects\rpc\src\mx\rpc\Responder.as:68] at mx.rpc::AsyncRequest/fault()[E:\dev\4.y\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:113] at DirectHTTPMessageResponder/securityErrorHandler()[E:\dev\4.y\frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:437] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/redirectEvent()
Gostei + 0
02/04/2014
Robson Morais
Gostei + 0
06/04/2014
Fernanda Acacia
Gostei + 0
06/04/2014
Robson Morais
Gostei + 0
07/04/2014
Joel Rodrigues
Gostei + 0
07/04/2014
Robson Morais
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)