$xmldoc->loadXML($nfe,LIBXML_NOBLANKS | LIBXML_NOEMPTYTAG);
//extrair a tag com os dados a serem assinados
$infNFe = $xmldoc->getElementsByTagName($tagid)->item(0);
//extrai os dados da tag para uma string
$dados = $infNFe->C14N(FALSE,FALSE,NULL,NULL);
//calcular o hash dos dados
$hashValue = hash('sha1',$dados,TRUE);
//converte o valor para base64 para serem colocados no xml
$digValue = base64_encode($hashValue);
2009-07-24 15:16:19.155743 soap_transport_http: set cURL HTTP headers
2009-07-24 15:16:19.155966 soap_transport_http: set cURL payload
2009-07-24 15:16:19.156206 soap_transport_http: send and receive with cURL
2009-07-24 15:16:19.288690 soap_transport_http: cURL ERROR: 58: unable to use client certificate (no key found or wrong pass phrase?)<br>url: https://homologacao.nfe.sefazvirtual.rs.gov.br:443/ws/nferecepcao/NfeRecepcao.asmx?WSDL<br>content_type: <br>http_code: 0<br>header_size: 0<br>request_size: 0<br>filetime: -1<br>ssl_verify_result: 0<br>redirect_count: 0<br>total_time: 0<br>namelookup_time: 0<br>connect_time: 0.132<br>pretransfer_time: 0<br>size_upload: 0<br>size_download: 0<br>speed_download: 0<br>speed_upload: 0<br>download_content_length: 0<br>upload_content_length: 0<br>starttransfer_time: 0<br>redirect_time: 0<br>
2009-07-24 15:16:19.288963 soap_transport_http: end of send()
2009-07-24 15:16:19.289238 wsdl: HTTP ERROR: cURL ERROR: 58: unable to use client certificate (no key found or wrong pass phrase?)<br>url: https://homologacao.nfe.sefazvirtual.rs.gov.br:443/ws/nferecepcao/NfeRecepcao.asmx?WSDL<br>content_type: <br>http_code: 0<br>header_size: 0<br>request_size: 0<br>filetime: -1<br>ssl_verify_result: 0<br>redirect_count: 0<br>total_time: 0<br>namelookup_time: 0<br>connect_time: 0.132<br>pretransfer_time: 0<br>size_upload: 0<br>size_download: 0<br>speed_download: 0<br>speed_upload: 0<br>download_content_length: 0<br>upload_content_length: 0<br>starttransfer_time: 0<br>redirect_time: 0<br>
2009-07-24 15:16:19.289540 nusoap_client: checkWSDL
2009-07-24 15:16:19.289795 nusoap_client: got wsdl error: HTTP ERROR: cURL ERROR: 58: unable to use client certificate (no key found or wrong pass phrase?)<br>url: https://homologacao.nfe.sefazvirtual.rs.gov.br:443/ws/nferecepcao/NfeRecepcao.asmx?WSDL<br>content_type: <br>http_code: 0<br>header_size: 0<br>request_size: 0<br>filetime: -1<br>ssl_verify_result: 0<br>redirect_count: 0<br>total_time: 0<br>namelookup_time: 0<br>connect_time: 0.132<br>pretransfer_time: 0<br>size_upload: 0<br>size_download: 0<br>speed_download: 0<br>speed_upload: 0<br>download_content_length: 0<br>upload_content_length: 0<br>starttransfer_time: 0<br>redirect_time: 0<br>
Assinei me baseando na classe do amigo Roberto, mais especificamente a função :
public function assina($docxml, $tagid='', $outDir='') da classNFEtools.php
Abraços.
No retorno da NFe, as vezes o cStat =105 (em processamento) , isto ocorre
quando a Sefaz ainda esta em processamento.
Para solucionar este problema, coloquei um delay em JS de 2 s que deu certo.
setTimeout("alert('Processando')",2000);
O ideal é ficar dando uma varredura até sair do 105, passaram por isto?
o que vcs fizeram?
Att:
Walber Sales
Reunem a gALLera. O Chopp deixa comigo.