Acceso a webservice para SII
Posted: Wed Apr 05, 2017 6:30 pm
Buenas tardes,
estoy haciendo pruebas para acceder al webservice de hacienda y poder enviar y recibir ficheros XML para el Suministro Inmediato de Información.
Este trozo de código :
La línea oHttp:status me devuelve 12004
He buscado en internet este número de status y no encuentro que puede ocurrir, ya sé que me falta usar un certificado digital pero no parece que sea lo que me está indicando ese código.
Muchas gracias por la ayuda.
estoy haciendo pruebas para acceder al webservice de hacienda y poder enviar y recibir ficheros XML para el Suministro Inmediato de Información.
Este trozo de código :
Code: Select all
local oHttp, cXML
local cUrl := "https://www7.aeat.es/wlpl/SSII-FACT/ws/fe/SiiFactFEV1SOAP"
cXML := MEMOREAD ( "SIIEmi.XML" )
oHttp := CreateObject ("MSXML2.XMLHTTP")
if oHttp = Nil
? 'Erro de creacion oHttp'
endif
oHttp:Open ( "POST", cUrl, .f. )
oHttp:SetRequestHeader ( "Content-Type", "text/xml;charset=UTF-8")
oHttp:SetRequestHeader ( "SOAPAction:", "" )
oHttp:SetRequestHeader ( "Connection:", "Keep-Alive")
oHttp:SetRequestHeader ( "Content-length", STR (LEN(cXML) ) )
try
oHttp:Send ( cXML )
catch
? oHttp:status
? 'Error en Send'
return .t.
end
? oHttp:responseText
He buscado en internet este número de status y no encuentro que puede ocurrir, ya sé que me falta usar un certificado digital pero no parece que sea lo que me está indicando ese código.
Muchas gracias por la ayuda.