Response of webservice did not return any PHP value

0

I am generating a query to a webservice in which as response I receive a .zip encoded in base64 so that I can decode it and get the .zip as such, with small zip I have no problem and I receive the response without any problem but, when making a request where the response will be a heavy zip, I do not receive any response.

Trying with the SuapUI program, if it gives me an answer regardless of the size, I'm missing something in my code?

Annex code and I hope you can help me, regards!

require("conexion.php");

    include('phpqrcode/qrlib.php');
    include('pdf_cert_encabezado.php');

    include('lib/nusoap.php');
    $client = new nusoap_client('CertificadosBasica.wsdl','true');

    $err = $client->getError();

    if ($err) { 
        echo 'Error en Constructor' . $err ; 
    }

    $numeroLote = $_POST['numeroLote'];
    $usuario = "usuario";
    $password = "password";

    //Generamos consulta para obtener el nombre del zip
    $resultados = $conexion->query("SELECT * FROM lote_ref WHERE numLote = '$numeroLote'");

    foreach($resultados as $fila){
        $nombre_zip = $fila['nombre_zip'];
    }

    //generamos la consulta al webservice para poder descargar el XML con el sello SEP.
    $param2 = array("numeroLote" => $numeroLote, "autenticacion" => array("usuario" => $usuario, "password" => $password));



    $result2 = $client->call('descargaCertificadosBasica', array('descargaCertificadosBasicaRequest' => $param2));


    $loteRetorno = "";
    $certificadosBase64 = "";
    $mensaje = "";


    if (empty($result2['numeroLote'])) {
        $mensaje = utf8_encode($result2['mensaje']);    
        echo $mensaje."<br><br>";
        echo "no estoy obteniendo respuesta";
    }else {
        $loteRetorno = $result2['numeroLote'];
        $certificadosBase64 = $result2['certificadosBase64'];
        //echo $loteRetorno."<br><br>";
        //echo $certificadosBase64;

        $file = base64_decode($certificadosBase64);

        //echo $certificadosBase64;

        $extension = ".zip";


        //toma el archivo, su nombre y la extension y genera el archivo en la carpeta selecciona
        $myfile = fopen("xml_cert_firmado/".$nombre_zip."firmado".$extension, "w") or die ("unable to open file!");
        fwrite($myfile, $file);
        fclose($myfile);

 }
    
asked by Eduardo Peña Omaña 08.06.2018 в 17:00
source

0 answers