Skip to content

Instantly share code, notes, and snippets.

View jatazoulja's full-sized avatar

Peter Eman Paver Abastillas jatazoulja

View GitHub Profile
@dbaltas
dbaltas / zend-soap-https-timeout-through-curl
Created May 10, 2012 15:53
Set Timeout on SOAP requests for https connections using curl on Zend Framework
function simulateSoapRequest($request, $location, $action, $version)
{
$client = new Zend_Http_Client($location);
$adapter = new Zend_Http_Client_Adapter_Curl();
$client->setAdapter($adapter);
$adapter->setCurlOption(CURLOPT_TIMEOUT, $this->_timeout);
$client->setMethod(Zend_Http_Client::POST);
$client->setHeaders('Content-Type', $version == 2 ? 'application/soap+xml' : 'text/xml');
$client->setHeaders('SOAPAction', $action);