Skip to content

Instantly share code, notes, and snippets.

@gierschv
Created July 25, 2012 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gierschv/ab1472140bd379c489b8 to your computer and use it in GitHub Desktop.
Save gierschv/ab1472140bd379c489b8 to your computer and use it in GitHub Desktop.
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