Hola, he estado haciendo pruebas de envio de pruebas de nomina. Al realizarlas por SOAP IU me arroja un ZIPKEY, pero ya cuando intento desde mi desarrollo personal me arroja:
http://www.w3.org/2005/08/addressing/soap/faults:Sendera:InvalidSecurityAn error occurred when verifying security for the message.
Este es mi codigo y agradezco si alguien puede darme un luz:
$Infoaenviar = '<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:wcf="http://wcf.dian.colombia" >
<soap:Header/>
<soap:Body>
<wcf:SendTestSetAsync>
<wcf:fileName'.$NombreZip.'</wcf:fileName>
<wcf:contentFile>'.$ZipBase64.'</wcf:contentFile>
<wcf:testSetId>d022736f-481e-44ba-b333-20082a715333</wcf:testSetId>
</wcf:SendTestSetAsync>
</soap:Body>
</soap:Envelope>';
$url = "https://vpfe-hab.dian.gov.co/WcfDianCustomerServices.svc?wsdl";
$xml_post_string = $Infoaenviar;
$keyFile = "/home/xxx/public_html/xxx/xxxx.key"; //
$caFile = "/home/xxx/public_html/xxx/xxxx.pem"; //
$certPass = "xxxx";
// xml post structure
$headers = array(
"Content-type: application/soap+xml; charset=\"utf-8\"",
"Accept: text/xml",
"Cache-Control: no-cache",
"Pragma: no-cache",
// "SOAPAction: '/Imp1/ApplicantEligibilityService",
"Content-length: " . strlen($xml_post_string),
); //SOAPAction: your op URL
//$url = $soapUrl;
// PHP cURL for https connection with auth
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
//curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_URL, $url);
// The --key option - If your key file has a password, you will need to set
// this with CURLOPT_SSLKEYPASSWD
// curl_setopt($ch, CURLOPT_SSLKEY, $keyFile);
curl_setopt($ch, CURLOPT_SSLKEY, $keyFile);
// The --cacert option
curl_setopt($ch, CURLOPT_SSLCERT, $caFile);
// The --cert option
//curl_setopt($ch, CURLOPT_SSLCERT, $certFile);
curl_setopt($ch, CURLOPT_SSLCERTPASSWD, $certPass);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// curl_setopt($ch, CURLOPT_USERPWD, $soapUser.":".$soapPassword); // username and password - declared at the top of the doc
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_TIMEOUT, 180);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_post_string); // the SOAP request
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
// converting
$response = curl_exec($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
echo 'HTTP code: ' . $httpcode;
echo '<br>';
echo "<pre>";
print_r($response);
echo "</pre>";
echo '<br>';
echo "<pre>";
print(curl_errno($ch));
echo "</pre>";
echo '<br>';
echo "<pre>";
print(curl_error($ch));
echo "</pre>";
curl_close($ch);
Nuevamente muchas gracias.