sfRequerimiento / RegFactuSistemaFacturacion
ASP AutoIt C C (Unicode) C++ C++ (Unicode) C# DataFlex Delphi Foxpro Go Java Node.js Objective-C Perl PHP Extension PowerBuilder Powershell PureBasic Python CkPython Ruby SQL Server Swift TCL VB.NET VB6 VBScript Xojo
<?php
include("chilkat.php");
// Use "chilkat_9_5_0.php" for versions of Chilkat < 10.0.0
$xml = new CkXml();
$xml->put_Tag('soapenv:Envelope');
$xml->AddAttribute('xmlns:soapenv','http://schemas.xmlsoap.org/soap/envelope/');
$xml->AddAttribute('xmlns:ds','http://www.w3.org/2000/09/xmldsig#');
$xml->AddAttribute('xmlns:sfLR','https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/tike/cont/ws/SuministroLR.xsd');
$xml->AddAttribute('xmlns:sf','https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/tike/cont/ws/SuministroInformacion.xsd');
$xml->UpdateChildContent('soapenv:Header','');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sf:Cabecera|sf:ObligadoEmision|sf:NombreRazon','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sf:Cabecera|sf:ObligadoEmision|sf:NIF','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sf:Cabecera|sf:RemisionVoluntaria|sf:FechaFinVeriFactu','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sf:Cabecera|sf:RemisionVoluntaria|sf:Incidencia','S');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sf:Cabecera|sf:RemisionRequerimiento|sf:RefRequerimiento','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:IDVersion','1.0');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:IDFactura|sf:IDEmisorFactura','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:IDFactura|sf:NumSerieFactura','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:IDFactura|sf:FechaExpedicionFactura','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:NombreRazonEmisor','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:Subsanacion','S');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:RechazoPrevio','N');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:TipoFactura','F1');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:TipoRectificativa','S');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:FacturasRectificadas|sf:IDFacturaRectificada|sf:IDEmisorFactura','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:FacturasRectificadas|sf:IDFacturaRectificada|sf:NumSerieFactura','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:FacturasRectificadas|sf:IDFacturaRectificada|sf:FechaExpedicionFactura','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:FacturasSustituidas|sf:IDFacturasSustituida|sf:IDEmisorFactura','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:FacturasSustituidas|sf:IDFacturasSustituida|sf:NumSerieFactura','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:FacturasSustituidas|sf:IDFacturasSustituida|sf:FechaExpedicionFactura','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:ImporteRectificacion|sf:BaseRectificada','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:ImporteRectificacion|sf:CuotaRectificada','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:ImporteRectificacion|sf:CuotaRecargoRectificado','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:FechaOperacion','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:DescripcionOperacion','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:FacturaSimplificadaArt7273','S');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:FacturaSinIdentifDestinatarioArt61d','S');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:Macrodato','S');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:EmitidaPorTerceroODestinatario','D');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:Tercero|sf:NombreRazon','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:Tercero|sf:NIF','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:Destinatarios|sf:IDDestinatario|sf:NombreRazon','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:Destinatarios|sf:IDDestinatario|sf:NIF','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:Cupon','S');
$xml->UpdateChildContentInt('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:Desglose|sf:DetalleDesglose|sf:ClaveRegimen',01);
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:Desglose|sf:DetalleDesglose|sf:CalificacionOperacion','S1');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:Desglose|sf:DetalleDesglose|sf:TipoImpositivo','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:Desglose|sf:DetalleDesglose|sf:BaseImponibleOimporteNoSujeto','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:Desglose|sf:DetalleDesglose|sf:BaseImponibleACoste','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:Desglose|sf:DetalleDesglose|sf:CuotaRepercutida','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:Desglose|sf:DetalleDesglose|sf:TipoRecargoEquivalencia','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:Desglose|sf:DetalleDesglose|sf:CuotaRecargoEquivalencia','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:CuotaTotal','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:ImporteTotal','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:Encadenamiento','');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:SistemaInformatico|sf:NombreRazon','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:SistemaInformatico|sf:NIF','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:SistemaInformatico|sf:NombreSistemaInformatico','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:SistemaInformatico|sf:IdSistemaInformatico','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:SistemaInformatico|sf:Version','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:SistemaInformatico|sf:NumeroInstalacion','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:SistemaInformatico|sf:TipoUsoPosibleSoloVerifactu','S');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:SistemaInformatico|sf:TipoUsoPosibleMultiOT','S');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:SistemaInformatico|sf:IndicadorMultiplesOT','S');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:FechaHoraHusoGenRegistro','dateTime');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:NumRegistroAcuerdoFacturacion','string');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:IdAcuerdoSistemaInformatico','string');
$xml->UpdateChildContentInt('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:TipoHuella',01);
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|sf:Huella','string');
$xml->UpdateAttrAt('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature',true,'Id','?');
$xml->UpdateAttrAt('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:SignedInfo',true,'Id','?');
$xml->UpdateAttrAt('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:SignedInfo|ds:CanonicalizationMethod',true,'Algorithm','?');
$xml->UpdateAttrAt('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:SignedInfo|ds:SignatureMethod',true,'Algorithm','?');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:SignedInfo|ds:SignatureMethod|ds:HMACOutputLength','integer');
$xml->UpdateAttrAt('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:SignedInfo|ds:Reference',true,'Id','?');
$xml->UpdateAttrAt('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:SignedInfo|ds:Reference',true,'URI','?');
$xml->UpdateAttrAt('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:SignedInfo|ds:Reference',true,'Type','?');
$xml->UpdateAttrAt('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:SignedInfo|ds:Reference|ds:Transforms|ds:Transform',true,'Algorithm','?');
$xml->UpdateAttrAt('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:SignedInfo|ds:Reference|ds:DigestMethod',true,'Algorithm','?');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:SignedInfo|ds:Reference|ds:DigestValue','BASE64_DATA');
$xml->UpdateChildContent('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:SignatureValue','...');
$xml->UpdateAttrAt('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:KeyInfo',true,'Id','?');
$xml->UpdateAttrAt('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:Object',true,'Id','?');
$xml->UpdateAttrAt('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:Object',true,'MimeType','?');
$xml->UpdateAttrAt('soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:Object',true,'Encoding','?');
// In a SOAP HTTP request, including the XML declaration (<?xml version="1.0" encoding="UTF-8"?>) in the XML body is generally not required.
$xml->put_EmitXmlDecl(false);
$soapRequestBody = $xml->getXml();
$endpoint = 'xxxxxxxxxx';
$soapAction = '';
// For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"
$contentType = 'text/xml';
$http = new CkHttp();
$http->ClearHeaders();
$http->SetRequestHeader('Content-Type',$contentType);
$http->SetRequestHeader('SOAPAction',$soapAction);
// resp is a CkHttpResponse
$resp = $http->PostXml($endpoint,$soapRequestBody,'utf-8');
if ($http->get_LastMethodSuccess() == false) {
print $http->lastErrorText() . "\n";
print 'Failed to send SOAP request.' . "\n";
exit;
}
// Get the XML response body.
$responseXml = new CkXml();
$resp->GetBodyXml($responseXml);
$statusCode = $resp->get_StatusCode();
print 'response status code: ' . $statusCode . "\n";
// If the status code does not indicate succcess, then show the response XML,
// which probably contains error information.
if ($statusCode != 200) {
print $responseXml->getXml() . "\n";
exit;
}
print $responseXml->getXml() . "\n";
// Parse the successful SOAP response XML.
// This is a sample of the response XML, but the namespace prefixes will be different.
// We can parse the result using "*" for the namespace prefixes (see below).
$CSV = $responseXml->getChildContent('*:Body|*:RespuestaRegFactuSistemaFacturacion|*:CSV');
$NIFPresentador = $responseXml->getChildContent('*:Body|*:RespuestaRegFactuSistemaFacturacion|*:DatosPresentacion|*:NIFPresentador');
$TimestampPresentacion = $responseXml->getChildContent('*:Body|*:RespuestaRegFactuSistemaFacturacion|*:DatosPresentacion|*:TimestampPresentacion');
$NombreRazon = $responseXml->getChildContent('*:Body|*:RespuestaRegFactuSistemaFacturacion|*:Cabecera|*:ObligadoEmision|*:NombreRazon');
$NIF = $responseXml->getChildContent('*:Body|*:RespuestaRegFactuSistemaFacturacion|*:Cabecera|*:ObligadoEmision|*:NIF');
$FechaFinVeriFactu = $responseXml->getChildContent('*:Body|*:RespuestaRegFactuSistemaFacturacion|*:Cabecera|*:RemisionVoluntaria|*:FechaFinVeriFactu');
$Incidencia = $responseXml->getChildContent('*:Body|*:RespuestaRegFactuSistemaFacturacion|*:Cabecera|*:RemisionVoluntaria|*:Incidencia');
$RefRequerimiento = $responseXml->getChildContent('*:Body|*:RespuestaRegFactuSistemaFacturacion|*:Cabecera|*:RemisionRequerimiento|*:RefRequerimiento');
$TiempoEsperaEnvio = $responseXml->getChildContent('*:Body|*:RespuestaRegFactuSistemaFacturacion|*:TiempoEsperaEnvio');
$EstadoEnvio = $responseXml->getChildContent('*:Body|*:RespuestaRegFactuSistemaFacturacion|*:EstadoEnvio');
$IDEmisorFactura = $responseXml->getChildContent('*:Body|*:RespuestaRegFactuSistemaFacturacion|*:RespuestaLinea|*:IDFactura|*:IDEmisorFactura');
$NumSerieFactura = $responseXml->getChildContent('*:Body|*:RespuestaRegFactuSistemaFacturacion|*:RespuestaLinea|*:IDFactura|*:NumSerieFactura');
$FechaExpedicionFactura = $responseXml->getChildContent('*:Body|*:RespuestaRegFactuSistemaFacturacion|*:RespuestaLinea|*:IDFactura|*:FechaExpedicionFactura');
$EstadoRegistro = $responseXml->getChildContent('*:Body|*:RespuestaRegFactuSistemaFacturacion|*:RespuestaLinea|*:EstadoRegistro');
$CodigoErrorRegistro = $responseXml->getChildContent('*:Body|*:RespuestaRegFactuSistemaFacturacion|*:RespuestaLinea|*:CodigoErrorRegistro');
$DescripcionErrorRegistro = $responseXml->getChildContent('*:Body|*:RespuestaRegFactuSistemaFacturacion|*:RespuestaLinea|*:DescripcionErrorRegistro');
$CSVRegistroDuplicado = $responseXml->getChildContent('*:Body|*:RespuestaRegFactuSistemaFacturacion|*:RespuestaLinea|*:CSVRegistroDuplicado');
$EstadoRegistroDuplicado = $responseXml->getChildContent('*:Body|*:RespuestaRegFactuSistemaFacturacion|*:RespuestaLinea|*:EstadoRegistroDuplicado');
?>