Web service registered ticket Santander

Asked

Viewed 2,343 times

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.

  1. 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

  2. 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>";
    }
    
  3. 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 ?

  • 1

    See if this relates to https://stackoverflow.com/a/28611495/1518921

  • @Guilhermenascimento I tried to use the solutions of the link you passed and none worked

  • @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 No. But I was sent an example of use. I put it on github, access this link and see if it helps you.

  • @Yeah, it’ll help, yeah!

  • @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 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.

Show 2 more comments

1 answer

-1

Solved.

The problem was in the value of the key local_cert array $options. I was passing the url online to access the certificate on the server, but should have passed only the location where it is in the project. Ex: cert/certificado.pem

Browser other questions tagged

You are not signed in. Login or sign up in order to post.