Почему бы не совместить? К примеру:
class SOAPHttpSender extends SoapClient
{
/**
* Overrides the __doRequest method of SoapClient
*
* @param $request Values to be sent via post/get method
* @param $location WSDL
* @param $action Soap action
* @param $version Soap version
* @return $response Boolean
*/
public function __doRequest($request,$location,$action,$version)
{
// Modify as per your requirement. For example, check out the Api-Key, user agent, soap action, etc. that we need to send in HTTP Header.
$headers = array('Method: POST','Connection: Close','User-Agent: YOUR-USER-AGENT','Content-Type: text/xml','Api-Key:XYZ','SOAPAction: "'.$action.'"', 'SOAPVersion: "'.$version.'"');
$ch = curl_init($location);
curl_setopt_array($ch, array(CURLOPT_VERBOSE => FALSE, CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_POST => TRUE, CURLOPT_POSTFIELDS => $request, CURLOPT_HEADER => FALSE, CURLOPT_HTTPHEADER => $headers));
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
}
?>