0

Making a query through SoapClient() I receive the following error message with PHP, the truth is that I had never worked with this type of application

<?php
    try{
        $opts = array(
            'http' => array (
                'user_agent' => 'PHPSoapClient' 
            )
        );

        $context = stream_context_create($opts);

        $soapClientOptions = array(
            'stream_context' => $context,
            'cache_wsdl' => WSDL_CACHE_NONE
        );

        $cliente = new SoapClient($rutWWSDL, $soapClientOptions);

        $parametros = array(
            'security' => $security,
            'txn' => 'MANCOMPRANOR',
            'message' => $message
        );

        $respuesta = $cliente->cardtransaction($parametros);
        echo '<pre>'; print_r($respuesta); echo '</pre>';

    }
    catch(Exception $e){
        echo 'Exception capturada: ', $e->getMessage(), "\n";
    }
?>

I guess the error may be in some parameter of the $opts options, but I'm not sure how to fix it

SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://... : failed to load external entity "https://..."

  • You work with https. It's not a problem of certificate...? You try with a parameter like ````verify_peer' => false```` ...? What did you enter in your variable ````$security````...? – Juan Sep 07 '22 at 07:49
  • In the security variable I define some parameters of the query. ` $security = array( 'comid' => 'SERVUNITYT', 'comkey' => '$erfins@', 'comwrkstation' => 'WORKSUNITYT' );` – William Barahona Sep 07 '22 at 14:27
  • May be this post can help you : https://stackoverflow.com/questions/12875409/soap-php-fault-parsing-wsdl-failed-to-load-external-entity – Juan Sep 07 '22 at 14:43

0 Answers0