Download SoapClient file

0

I use the PHP nusoap_client library to query a WSDL, this WSDL has an attachment in PDF format that I need to download, and try the following code

$response = $client->response;
$filename = "recibo";
$destination = dirname(__FILE__) . '/'.$filename.'.pdf';
$file = fopen($destination, "w+");
fputs($file, $response);
fclose($file);

But I do not save it correctly, check the WSDL with SOAP UI and if you send the PDF correctly, you know some other way to download the PDF.

This receipt from the WSDL

%PDF-1.2
%���
1 0 obj
<< /Type /Page
/Parent 3 0 R
/Resources 4 0 R
/Contents 2 0 R
>> endobj
2 0 obj <>

Thank you.

    
asked by Andrés 07.03.2018 в 17:29
source

1 answer

0

You could try the following

file_put_contents($destination, $response);

As they do here link , an estimate of the response you're getting of the WS

    
answered by 07.03.2018 в 18:00