1
I’m implementing Santander’s Boleto Registration Method via web service with PHP for a client. Digital certificate has already been acquired and installed on the client’s system server and also already installed at Banco Santander.
On my machine I imported the certificate in the browser and I can already access the url to get the security ticket.
https://ymbdlb.santander.com.br/dl-ticket-services/TicketEndpointService
The problem happens when I try to consume the web service with SOAP. In it I enter the ticket url and the options containing the path from where the file is. pem and the password for access.
try { $options = array('keep_alive' => false, 'trace' => true, 'local_cert' => 'https://(caminho).pem', 'passphrase' => '(senha)', 'cache_ws' => WSDL_CACHE_NONE ); $cliTicket = new SoapClient("https://ymbdlb.santander.com.br/dl-ticket-services/TicketEndpointService/TicketEndpointService.wsdl", $options); echo "CHAMANDO O DLB TICKET!!"; $xmlCreate = getTicketXml(); $cResponse = $cliTicket->create($xmlCreate); print_r($cResponse); } catch(SoapFault $e) { echo "EXCEÇÂO DO SOAP"; echo "<pre>"; print_r($e); echo "</pre>"; }After executing this code an exception is returned to me with the following message:
SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://ymbdlb.santander.com.br/dl-ticket-services/TicketEndpointService/TicketEndpointService.wsdl' : failed to load external entity "https://ymbdlb.santander.com.br/dl-ticket-services/TicketEndpointService/TicketEndpointService.wsdl"
Someone would know to tell me why this mistake happens ?
See if this relates to https://stackoverflow.com/a/28611495/1518921
– Guilherme Nascimento
@Guilhermenascimento I tried to use the solutions of the link you passed and none worked
– Abner Ferreira de Andrade
@Abnerferreiradeandrade I need to implement the online registration of Santander slips for my website, hosted on a shared linux hosting server. The solution you created is opensource?
– WarmBooter
@Warmbooter No. But I was sent an example of use. I put it on github, access this link and see if it helps you.
– Abner Ferreira de Andrade
@Yeah, it’ll help, yeah!
– WarmBooter
@Abnerferreiradeandrade I’m having the same error you had, with the difference that my server is Linux, and I’m using a certificate issued by cPanel (I sent his CRT to the bank and was accepted there). Detail: cPanel has no passphrase in the certificate, so I’m omitting this parameter in the options array. At local_cert, I have already tried to pass the full local path, relative path, etc and nothing solved. Have any idea what it might be?
– WarmBooter
@Warmbooter Sorry for the delay. Then you will have to generate the . pfx certificate from the . crt you have with the OPENSSL program. After generated import the . pfx in the browser and export by checking the option to export private key and the certification chain (it will also ask for a password from there you inform one you want). After export you will have to convert that exported . pfx to . pem with the same OPENSSL program. That certificate. pem will have the password you entered when generating and it should be informed in local_cert (local path from the code file), and in passphrase the password used.
– Abner Ferreira de Andrade