Skip to content

Instantly share code, notes, and snippets.

@cesjam7
Created September 14, 2020 22:56
Show Gist options
  • Save cesjam7/d34159fd72697f98b0db540bd72866ce to your computer and use it in GitHub Desktop.
Save cesjam7/d34159fd72697f98b0db540bd72866ce to your computer and use it in GitHub Desktop.
<?php $xmlsunat = file_get_contents("20552543549-09-TF01-1.zip");
$base64 = base64_encode($xmlsunat);
try{
$client = new SoapClient('https://e-beta.sunat.gob.pe/ol-ti-itemision-guia-gem-beta/billService?wsdl');
$res = $client->sendBill(array(
'fileName' => '20552543549-09-TF01-1.zip',
'contentFile' => $base64,
'partyType' => 'ns1:billService'
));
} catch (SoapFault $e){
echo '<pre>';
print_r($client);
echo '</pre>';
// or other error handling
} ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment