Buenos dias, cuando ejecuto el codigo que presento a continuacion me da este error:
ERROR: Parsing WSDL: Couldn't load from ' string(4) "WSDL"
Que puede ser?
<?php
crear(); //Creamos el archivo
enviarurl();
function enviarurl(){
ini_set("default_socket_timeout", 6000);
$doc=new DomDocument();
$doc->load('operaciones.xml');
ini_set("soap.wsdl_cache_enabled","0");
//desarrollo
// $wsdl = trim(file_get_contents('http://sis-d.redsys.es/TPV_PC/services/SerClsWSPeticionSOAP/wsdl/SerClsWSPeticionSOAP.wsdl'));
//integracion
//$client=new SoapClient('https://tpvpc-i.redsys.es:27443/TPV_PC/services/SerClsWSPeticionSOAP/wsdl/SerClsWSPeticionSOAP.wsdl');
$wsdl=trim(file_get_contents('https://tpvpc-i.redsys.es:27443/TPV_PC/services/SerClsWSPeticionSOAP/wsdl/SerClsWSPeticionSOAP.wsdl'));
try{
$client=new SoapClient($wsdl);
}
catch (SoapFault $e) {
var_dump(libxml_get_last_error());
var_dump($e);
}
}
function crear(){
$Notarjeta='4599900058328675';
$Fechacaducidad='1018';
$Codigocvc2='916';
$Tipomoneda='978';
$Totalimporte='1.00';
$Nocomercio='332729730';
$Noterminal='2';
$DesctipoPago='PAGO';
$Notimestamp=date("Ymd His");
$codigoclave='8rayito1953';
$finalcadena = "$DesctipoPago$Notarjeta$Fechacaducidad$Totalimpor te$Tipomoneda$Nocomercio$Noterminal$Notimestamp$co digoclave";
$Lafirma = sha1($finalcadena);
$xml = new DomDocument('1.0', 'UTF-8');
$operaciones = $xml->createElement('operaciones');
$operaciones = $xml->appendChild($operaciones);
$operacion = $xml->createElement('operacion');
$operacion = $operaciones->appendChild($operacion);
$datosPago = $xml->createElement('datosPago');
$datosPago = $operacion->appendChild($datosPago);
$datosPagoTarjeta = $xml->createElement('datosPagoTarjeta');
$datosPagoTarjeta = $datosPago->appendChild($datosPagoTarjeta);
$tarjeta = $xml->createElement('tarjeta',$Notarjeta);
$tarjeta = $datosPagoTarjeta->appendChild($tarjeta);
$caducidad = $xml->createElement('caducidad',$Fechacaducidad);
$caducidad = $datosPagoTarjeta->appendChild($caducidad);
$cvc2 = $xml->createElement('cvc2',$Codigocvc2);
$cvc2 = $datosPagoTarjeta->appendChild($cvc2);
$datosCompra = $xml->createElement('datosCompra');
$datosCompra= $operacion->appendChild($datosCompra);
$moneda = $xml->createElement('moneda',$Tipomoneda);
$moneda = $datosCompra->appendChild($moneda);
$importe = $xml->createElement('importe',$Totalimporte);
$importe = $datosCompra->appendChild($importe);
$comercio = $xml->createElement('comercio',$Nocomercio);
$comercio = $datosCompra->appendChild($comercio);
$terminal = $xml->createElement('terminal',$Noterminal);
$terminal = $datosCompra->appendChild($terminal);
$tipopago = $xml->createElement('tipopago',$DesctipoPago);
$tipopago = $datosCompra->appendChild($tipopago);
$timestamp = $xml->createElement('timestamp',$Notimestamp);
$timestamp = $operacion->appendChild($timestamp);
$firma = $xml->createElement('firma',$Lafirma);
$firma = $operacion->appendChild($firma);
$xml->formatOutput = true;
$el_xml = $xml->saveXML();
$xml->save('operaciones.xml');
}
?>