Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SOAP-ERROR no buscaCliente() #23

Closed
vitalibr opened this issue Jan 5, 2016 · 7 comments
Closed

SOAP-ERROR no buscaCliente() #23

vitalibr opened this issue Jan 5, 2016 · 7 comments

Comments

@vitalibr
Copy link

vitalibr commented Jan 5, 2016

Estou tentando executar o exemplo do buscaCliente()
http://127.0.0.1:8080/php-sigep/exemplos/buscaCliente.php

e estou recebendo o erro SOAP-ERROR

object(PhpSigep\Services\Result)#10 (6) {
["isSoapFault":protected]=>
bool(true)
["errorCode":protected]=>
int(0)
["errorMsg":protected]=>
string(254) "SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://apphom.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente?wsdl' : failed to load external entity "https://apphom.correios.com.br/SigepMasterJPA/AtendeClienteService/AtendeCliente?wsdl"
"
["result":protected]=>
NULL
["soapFault":protected]=>
NULL
["_failIfAtributeNotExiste":protected]=>
bool(true)
}

@stavarengo
Copy link
Owner

@vitalibr tenta colocar o WSDL local. Já fez isso?

@vitalibr
Copy link
Author

vitalibr commented Jan 5, 2016

@stavarengo eu tentei e não deu certo, o estranho foi que troquei a implementação do método getSoapClient() e funcionou.

Fiz assim:

public static function getSoapClient()
{
if (!self::$_soapClient) {
$wsdl = Bootstrap::getConfig()->getWsdlAtendeCliente();
$opts = array(
'ssl' => array(
'ciphers' =>'RC4-SHA',
'verify_peer' =>false,
'verify_peer_name' =>false
)
);
// SOAP 1.1 client
$params = array (
'encoding' => self::WEB_SERVICE_CHARSET,
'verifypeer' => false,
'verifyhost' => false,
'soap_version' => SOAP_1_1,
'trace' => Bootstrap::getConfig()->getEnv() != Config::ENV_PRODUCTION,
'exceptions' => Bootstrap::getConfig()->getEnv() != Config::ENV_PRODUCTION,
"connection_timeout" => 180,
'stream_context' => stream_context_create($opts)
);
self::$_soapClient = new \SoapClient($wsdl, $params);
}
return self::$_soapClient;
}


Minhas configuraçoes
XAMPP for Windows 5.6.15 5.6.15
Windows 8.1
PHP Version 5.6.15

php.ini está habilitado:
extension=php_openssl.dll
extension=php_curl.dll
extension=php_xmlrpc.dll

@rafaelsiqueira
Copy link
Contributor

O problema está no certificado do ambiente de homologação, conforme o link a seguir: http://grab.by/N7mG

O que você pode tentar fazer, é ignorar o certificado ssl (para fins de testes), conforme thread do stackoverflow: http://stackoverflow.com/questions/8443618/disable-certificate-verification-in-php-soapclient

Abs,

@stavarengo
Copy link
Owner

Pessoal estou na dúvida.
A correção deste bug já foi mesclado na master?

@gustvao
Copy link
Contributor

gustvao commented Mar 14, 2016

@stavarengo aparentemente não.

você não quer mesclar? aparentemente isso acontece com a OpenSSL > 1.0. Atualizei meu php do 5.5 pro 5.6 e comecou a quebrar.

Parece que o @vitalibr resolveu a sacada e até postou no stack-overflow

http://stackoverflow.com/questions/34609448/soap-error-parsing-wsdl-couldnt-load-from-xampp

Você solta o hotfix?

Obg

@gustvao
Copy link
Contributor

gustvao commented Mar 14, 2016

@stavarengo facilitei sua vida com um PR #38

@stavarengo
Copy link
Owner

Pronto Gustavo, valeu.

On Mon, Mar 14, 2016 at 5:55 PM, Gustavo Bobrow notifications@github.com
wrote:

@stavarengo https://github.com/stavarengo facilitei sua vida com um PR:
#38 #38


Reply to this email directly or view it on GitHub
#23 (comment)
.

Rafael Stavarengo
stapi.com.br - Linkedin
http://t.sidekickopen45.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJW7t5XYg1p7-ZxW7gs8101pNv9jW7fsFDW56dKw1f2bXyYM02?t=http%3A%2F%2Fbr.linkedin.com%2Fpub%2Frafael-stavarengo%2F1a%2F338%2F2a1%2F&si=6484137984655360&pi=b4326760-d3bb-4da5-e93a-1281b039461d
Skype: rafael.stavarengo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants