Jump to content

ayuda con php5.6 y curl


Recommended Posts

durante mucho tiempo he enviado los archivos a sii mediante CURL en php.
pero al actualizar el servidor ya no funciona (php 5.6), asumo que es por que estan obsoletas.
Este es el fuente que uso:
_______________________________________________________________
$data = [
'rutSender' => $this->rutEnvia[0],
'dvSender' => $this->rutEnvia[1],
'rutCompany' => $this->rutEmpresa[0],
'dvCompany' => $this->rutEmpresa[1],
'archivo' => $this-> curl_file_create(
$this->fileXML,
'application/xml',
basename($this->fileXML)
),
];

$curl = curl_init();
if($this->METHOD=="POST"):
curl_setopt($curl, CURLOPT_POST, true);
endif;
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
curl_setopt($curl, CURLOPT_HTTPHEADER, $this->headers);
curl_setopt($curl, CURLOPT_URL, $this->URL);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); //


for ($i=0; $i<$retry; $i++) {
$response .= curl_exec($curl);
$this->RESPONSE = $response;
if ($response and $response!='Error 500')
break;
}
_____________________________________________________________
debido a esto todas las respuestas entregan el siguiente error :
<RECEPCIONDTE>
<RUTSENDER>14734627-6</RUTSENDER>
<RUTCOMPANY>0-0</RUTCOMPANY>
<FILE></FILE>
<TIMESTAMP>2019-01-30 15:33:20</TIMESTAMP>
<STATUS>7</STATUS>

<DETAIL>
<ERROR>CHR-00004: no se encontro envio(XML)</ERROR>
</DETAIL>
____________________________________________________________

Agradeceria su ayuda. T_T

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...