Dim xml As NewChilkat.Xml
xml.Tag = "soapenv:Envelope"Dim success As Boolean
success = xml.AddAttribute("xmlns:soapenv","http://schemas.xmlsoap.org/soap/envelope/")
success = xml.AddAttribute("xmlns:ds","http://www.w3.org/2000/09/xmldsig#")
success = xml.AddAttribute("xmlns:sfLR","https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/tike/cont/ws/SuministroLR.xsd")
success = 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"
success = xml.UpdateAttrAt("soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature",True,"Id","?")
success = xml.UpdateAttrAt("soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:SignedInfo",True,"Id","?")
success = xml.UpdateAttrAt("soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:SignedInfo|ds:CanonicalizationMethod",True,"Algorithm","?")
success = 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"
success = xml.UpdateAttrAt("soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:SignedInfo|ds:Reference",True,"Id","?")
success = xml.UpdateAttrAt("soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:SignedInfo|ds:Reference",True,"URI","?")
success = xml.UpdateAttrAt("soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:SignedInfo|ds:Reference",True,"Type","?")
success = xml.UpdateAttrAt("soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:SignedInfo|ds:Reference|ds:Transforms|ds:Transform",True,"Algorithm","?")
success = 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","..."
success = xml.UpdateAttrAt("soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:KeyInfo",True,"Id","?")
success = xml.UpdateAttrAt("soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:Object",True,"Id","?")
success = xml.UpdateAttrAt("soapenv:Body|sfLR:RegFactuSistemaFacturacion|sfLR:RegistroFactura|sfLR:RegistroAlta|ds:Signature|ds:Object",True,"MimeType","?")
success = 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.EmitXmlDecl = FalseDim soapRequestBody As String
soapRequestBody = xml.GetXml()
Dim endpoint As String
endpoint = "xxxxxxxxxx"Dim soapAction As String
soapAction = ""// For SOAP requests, the standard Content-Type is usually set to "text/xml" or "application/soap+xml"Dim contentType As String
contentType = "text/xml"Dim http As NewChilkat.Http
http.ClearHeaders
http.SetRequestHeader"Content-Type",contentType
http.SetRequestHeader"SOAPAction",soapAction
Dim resp AsChilkat.HttpResponse
resp = http.PostXml(endpoint,soapRequestBody,"utf-8")
If (http.LastMethodSuccess = False) Then
System.DebugLog(http.LastErrorText)
System.DebugLog("Failed to send SOAP request.")
ReturnEnd If// Get the XML response body.Dim responseXml As NewChilkat.Xml
success = resp.GetBodyXml(responseXml)
Dim statusCode As Int32
statusCode = resp.StatusCode
System.DebugLog("response status code: " + Str(statusCode))
// If the status code does not indicate succcess, then show the response XML,
// which probably contains error information.If (statusCode <> 200) Then
System.DebugLog(responseXml.GetXml())
ReturnEnd If
System.DebugLog(responseXml.GetXml())
// 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).Dim CSV As String
CSV = responseXml.GetChildContent("*:Body|*:RespuestaRegFactuSistemaFacturacion|*:CSV")
Dim NIFPresentador As String
NIFPresentador = responseXml.GetChildContent("*:Body|*:RespuestaRegFactuSistemaFacturacion|*:DatosPresentacion|*:NIFPresentador")
Dim TimestampPresentacion As String
TimestampPresentacion = responseXml.GetChildContent("*:Body|*:RespuestaRegFactuSistemaFacturacion|*:DatosPresentacion|*:TimestampPresentacion")
Dim NombreRazon As String
NombreRazon = responseXml.GetChildContent("*:Body|*:RespuestaRegFactuSistemaFacturacion|*:Cabecera|*:ObligadoEmision|*:NombreRazon")
Dim NIF As String
NIF = responseXml.GetChildContent("*:Body|*:RespuestaRegFactuSistemaFacturacion|*:Cabecera|*:ObligadoEmision|*:NIF")
Dim FechaFinVeriFactu As String
FechaFinVeriFactu = responseXml.GetChildContent("*:Body|*:RespuestaRegFactuSistemaFacturacion|*:Cabecera|*:RemisionVoluntaria|*:FechaFinVeriFactu")
Dim Incidencia As String
Incidencia = responseXml.GetChildContent("*:Body|*:RespuestaRegFactuSistemaFacturacion|*:Cabecera|*:RemisionVoluntaria|*:Incidencia")
Dim RefRequerimiento As String
RefRequerimiento = responseXml.GetChildContent("*:Body|*:RespuestaRegFactuSistemaFacturacion|*:Cabecera|*:RemisionRequerimiento|*:RefRequerimiento")
Dim TiempoEsperaEnvio As String
TiempoEsperaEnvio = responseXml.GetChildContent("*:Body|*:RespuestaRegFactuSistemaFacturacion|*:TiempoEsperaEnvio")
Dim EstadoEnvio As String
EstadoEnvio = responseXml.GetChildContent("*:Body|*:RespuestaRegFactuSistemaFacturacion|*:EstadoEnvio")
Dim IDEmisorFactura As String
IDEmisorFactura = responseXml.GetChildContent("*:Body|*:RespuestaRegFactuSistemaFacturacion|*:RespuestaLinea|*:IDFactura|*:IDEmisorFactura")
Dim NumSerieFactura As String
NumSerieFactura = responseXml.GetChildContent("*:Body|*:RespuestaRegFactuSistemaFacturacion|*:RespuestaLinea|*:IDFactura|*:NumSerieFactura")
Dim FechaExpedicionFactura As String
FechaExpedicionFactura = responseXml.GetChildContent("*:Body|*:RespuestaRegFactuSistemaFacturacion|*:RespuestaLinea|*:IDFactura|*:FechaExpedicionFactura")
Dim EstadoRegistro As String
EstadoRegistro = responseXml.GetChildContent("*:Body|*:RespuestaRegFactuSistemaFacturacion|*:RespuestaLinea|*:EstadoRegistro")
Dim CodigoErrorRegistro As String
CodigoErrorRegistro = responseXml.GetChildContent("*:Body|*:RespuestaRegFactuSistemaFacturacion|*:RespuestaLinea|*:CodigoErrorRegistro")
Dim DescripcionErrorRegistro As String
DescripcionErrorRegistro = responseXml.GetChildContent("*:Body|*:RespuestaRegFactuSistemaFacturacion|*:RespuestaLinea|*:DescripcionErrorRegistro")
Dim CSVRegistroDuplicado As String
CSVRegistroDuplicado = responseXml.GetChildContent("*:Body|*:RespuestaRegFactuSistemaFacturacion|*:RespuestaLinea|*:CSVRegistroDuplicado")
Dim EstadoRegistroDuplicado As String
EstadoRegistroDuplicado = responseXml.GetChildContent("*:Body|*:RespuestaRegFactuSistemaFacturacion|*:RespuestaLinea|*:EstadoRegistroDuplicado")