Error: Unknown Content-Encoding- PHP consuming WSDL with SoapClient

1

I have this problem when trying to consume a web service wsdl:

  

Unknown Content-Encoding

I have tried compressing it in GZIP by sending it the charset, but at the moment of executing it, it gives me this error.

The code in php for this consumption is the following:

$usuario="user1";
$location_URL = "https://www.txstestrbm.com/GlobalPayServicios/GlobalPayServicioDePago";
$pass="abc123";
$wsdl="https://www.pagosrbm.com/GlobalPayServicios/GlobalPayServicioDePago/GlobalPayServicioDePago.wsdl";
$mode = array (
    'soap_version'  => 'SOAP_1_1', // use soap 1.1 client
    'keep_alive'    => true,
    'trace'         => 1,
    'encoding'      => utf-8,
    'compression'   => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | SOAP_COMPRESSION_DEFLATE,
    'Content-Encoding'=> 'UTF-8',
    'exceptions'    => true,
    'cache_wsdl'    => WSDL_CACHE_NONE,
);
$options = array(
    'trace'=>true,
    'location' => $location_URL,
    'credenciales' => array(
        'idUsuario'    => $usuario,
        'clave' => $pass
    ),
    'cabeceraSolicitud' =>array(
        'infoPuntoInteraccion'=> array(
            'tipoTerminal'=> 'GlobalPay',
            'idTerminal'=>'ESB10457',
            'idAdquiriente'=>'0014591978',
            'idTransaccionTerminal'=>'0101'
        )
    ),
    'infoCompra' => array(
        'numeroFactura' => '',
        'montoTotal' => '',
        'infoImpuestos' => array(
            'tipoImpuesto'=>'iva',   
            'monto' =>'0'
        ),
        'montoDetallado' => array(
           'tipoMontoDetallado'=>'precio',
           'monto'=> '10000'
        ),
    ),
);

try {
    $soap = new SoapClient($wsdl, $mode);  
    $data = $soap->IniciarTransaccionDeCompra($options);
} catch(Exception $e) {
    die($e->getMessage());
}
var_dump($data);
die;

The page can be consulted here . I would appreciate someone if you can help me with this error.

    
asked by diego alejandro franco osorio 15.02.2016 в 21:20
source

2 answers

1

The problem is that you are not connecting to TLSv1.2 , and you do not use certificates .cert files, which they should have given you, to call the service. Also, that url is not the one you should use for tests, use the wsdl file, upload it to the server and put it next to it. This completes well the header of the message soap 'local_cert' => 'www.txstestrbm.com.cer' , is the most important, then you must make 10 use cases and send them to give you the original certificates. I think you should contact the people on the button or try it for soap UI , and if it works, then send a payload , and that's it.

    
answered by 25.10.2016 в 02:44
0

Encoding must go within quotes:

  'encoding'      => utf-8,

Changes to:

  'encoding'      =>'UTF-8',

For that reason it does not detect the encoding.

  • Also make sure you set up your php.ini :

zlib.output_compression = On

    
answered by 15.02.2016 в 21:52