Error Fetching http headers in soap php

0

I have a WS where I try to consume another WS in the following way:

$parametros=array($valores["subdependencia"],$valores['usuario'],$valores['origen'],$valores["cveProveedor"],$valores["numOC"],$valores["rfcProveedor"],(($valores['usuario']=='PROVEEDOR')?($valores["rfcProveedor"]):($valores['usuario'])),$valores['dependenciaLogin'],$valores['subDependenciaLogin'],"",$valores["nomPdf"],$valores["nomarch"],$valores["intTamXml"],$valores["intTamPdf"],$valores["strTipoXml"],$valores["strTipoPdf"],$valores["strContenidoXml"],$valores["strContenidoPdf"]);            
$cliente=null;
$arrDatos=null;
$fault=null;
try{
    $cliente= new SoapClient(URL_WS_SOAP,array('trace' => 1,'login'=>'usuario','password' => 'pass'));//Pruebas
    $arrDatos = $cliente->__soapCall('guardaCFDI',$parametros);
}catch(SoapFault $fault){
    $errorSoapFault= "SOAPFault: ".$fault->faultcode."-".$fault->faultstring."\n";
}
$responseHeaders = $cliente->__getLastResponseHeaders();
preg_match("/HTTP\/\d\.\d\s*\K[\d]+/", $responseHeaders,$statusHttp);

//Si hay respuesta      
if($statusHttp[0] == "200" && $fault==null){
    //Resto de codigo
}else{
    return "Error WS_DGCPI(". $fault->faultcode ."):".$fault->faultstring;
}

I've tried it with a client I did myself, and I've tried it with SOAPUI but it always returns the following:

Error WS_DGCPI(HTTP):Error Fetching http headers

It is worth mentioning that the files I send are in base64. Does anyone have any idea how to fix this error?

    
asked by abrahamhs 03.10.2017 в 18:50
source

2 answers

0

I already solved it: Actually the problem was that the firewall is blocking the SOAP requests on the server. Once enabled the problem stopped happening.

    
answered by 13.12.2017 / 17:00
source
1

This is due to socket_timeout , see this documentation DOCUMENTATION .

You can increase this value in your script by putting this line:

ini_set('default_socket_timeout', 600);//o el valor que quieras

Or in your php.ini :

default_socket_timeout = 120
    
answered by 13.12.2017 в 12:12