Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/11/2015, 07:31
lmoisesrojas
Usuario no validado
 
Fecha de Ingreso: octubre-2015
Mensajes: 10
Antigüedad: 8 años, 6 meses
Puntos: 0
Problema con webservice en PHP

Esto utilizando el siguiente programa en PHP para llamar un webservice, pero solo obtengo este error utilizando WAMP, y realmente: NO SE LO QUE ME QUIERE DECIR. Alguna ayuda por favor?

Error en WAMP
1. Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't load from;

2. Warning: SoapClient::SoapClient() [soapclient.soapclient]: I/O warning : failed to load external entity "<?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions targetNamespace="http://webservices.tpvpc.sermepa.es" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://webservices.tpvpc.sermepa.es" xmlns:intf="http://webservices.tpvpc.sermepa.es" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <wsdl:types> <schema elementFormDefault="qualified" targetNamespace="http://webservices.tpvpc.sermepa.es" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://webservices.tpvpc.sermepa.es" xmlns:intf="http://webservices.tpvpc.sermepa.es" xmlns:wsd in C:\wamp\www\tpvgaia\guardar.php on line 25






Anexo codigo
<?php
crear(); //Creamos el archivo
enviarurl();
function enviarurl(){
ini_set("default_socket_timeout", 6000);
ini_set("soap.wsdl_cache_enabled", "0");
ini_set("soap.wsdl_cache", "0");
ini_set("display_errors","On");
ini_set("track_errors","On");
$soap_args = array(
'exceptions'=>true,
'trace'=>1);
$doc=new DomDocument();
$doc->load('operaciones.xml');
ini_set("soap.wsdl_cache_enabled","0");
$wsdl = trim(file_get_contents('https://tpvpc.redsys.es/TPV_PC/services/SerClsWSPeticionSOAP/wsdl/SerClsWSPeticionSOAP.wsdl'));
try{
$client=new SoapClient($wsdl,$soap_args);
$resultado=$client ->trataPeticionPago($doc);
print_r($resultado);
}
catch (Exception $e){
echo ('En el catch');
echo $e ->getMessage();
}
}
function crear(){
$Notarjeta='4599900058328675';
$Fechacaducidad='1018';
$Codigocvc2='916';
$Tipomoneda='978';
$Totalimporte='1.00';
$Nocomercio='332729730';
$Noterminal='2';
$DesctipoPago='PAGO';
$Notimestamp=date("Ymd His");
$codigoclave='9rayito1953';
$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');
}
?>