Skip to content

Instantly share code, notes, and snippets.

@gierschv
Created Jul 25, 2012
Embed
What would you like to do?
Work-around libssl 1.0.0 - SSV3
<?php
class SoapClientSSLv3 extends SoapClient {
protected function callCurl($url, $data) {
$handle = curl_init();
curl_setopt($handle, CURLOPT_URL, $url);
curl_setopt($handle, CURLOPT_HTTPHEADER, Array('Content-Type: text/xml'));
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handle, CURLOPT_POSTFIELDS, $data);
curl_setopt($handle, CURLOPT_SSLVERSION, 3);
$response = curl_exec($handle);
if (empty($response)) {
throw new SoapFault('CURL error: '.curl_error($handle), curl_errno($handle));
}
curl_close($handle);
return $response;
}
public function __doRequest($request, $location, $action, $version, $one_way = 0) {
return $this->callCurl($location, $request);
}
}
$soapi = new SoapClientSSLv3('soapi-re-1.44.wsdl');
$session = $soapi->login('login', 'pass', 'fr');
var_dump($soapi->telephonyLineList($session, 'billing'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment