Created
September 14, 2020 22:56
-
-
Save cesjam7/d34159fd72697f98b0db540bd72866ce to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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