Buenas, me esta pasando un error parecido en el proyecto que tengo en php para el tema de verifactu, inteno crear el cliente SOAP y todo el rato me sale este error:
Error:
Código:
message =
"SOAP-ERROR: Parsing WSDL: Couldn't load from 'h_t_t_p_s://prewww1.aeat.es/wlpl/TIKE-CONT/ws/SistemaFacturacion/VerifactuSOAP' : failed to load external entity "h_t_t_p_s://prewww1.aeat.es/wlpl/TIKE-CONT/ws/SistemaFacturacion/VerifactuSOAP"
"
*Exception*string =
""
code =
0
file =
"C:\xampp\htdocs\factu\funciones\funciones_verifactu.php"
line =
489
*Exception*trace =
array(2)
*Exception*previous =
null
faultstring =
"SOAP-ERROR: Parsing WSDL: Couldn't load from 'h_t_t_p_s://prewww1.aeat.es/wlpl/TIKE-CONT/ws/SistemaFacturacion/VerifactuSOAP' : failed to load external entity "h_t_t_p_s://prewww1.aeat.es/wlpl/TIKE-CONT/ws/SistemaFacturacion/VerifactuSOAP"
"
faultcode =
"WSDL"
Este es el codigo para generar el SOAP client:
Código PHP:
$client = new SoapClient((string) $wsdlUrl, [
'local_cert' => $filename,
'passphrase' => $certificatePassword,
'cache_wsdl' => WSDL_CACHE_NONE,
'soap_version' => SOAP_1_1,
'style' => SOAP_DOCUMENT,
'use' => SOAP_LITERAL,
'trace' => 1,
'exceptions' => 1,
]);
La ruta que estoy usando para acceder a la AEAT es esta :
Código PHP:
$wsdlUrl = 'h_t_t_p_s://prewww1.aeat.es/wlpl/TIKE-CONT/ws/SistemaFacturacion/VerifactuSOAP';
Y estoy usando los certificados de pruebas que da la AEAT, el XML que estoy intentando subir es este:
Código:
<soapenv:Envelope xmlns:soapenv="h_t_t_p://schemas.xmlsoap.org/soap/envelope/" xmlns:con="h_t_t_p_s://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/tike/cont/ws/ConsultaLR.xsd" xmlns:sum="h_t_t_p_s://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/tike/cont/ws/SuministroInformacion.xsd">
<soapenv:Header/>
<soapenv:Body>
<con:ConsultaFactuSistemaFacturacion>
<con:Cabecera>
<sum:IDVersion>1.0</sum:IDVersion>
<sum:ObligadoEmision>
<sum:NombreRazon>Certificado Pruebas</sum:NombreRazon>
<sum:NIF>A39200019</sum:NIF>
</sum:ObligadoEmision>
</con:Cabecera>
<con:FiltroConsulta>
<con:PeriodoImputacion>
<sum:Ejercicio>2025</sum:Ejercicio>
<sum:Periodo>04</sum:Periodo>
</con:PeriodoImputacion>
</con:FiltroConsulta>
</con:ConsultaFactuSistemaFacturacion>
</soapenv:Body>
</soapenv:Envelope>