Skip to content

Instantly share code, notes, and snippets.

@umpirsky
Created June 27, 2011 13:51
Show Gist options
  • Save umpirsky/1048888 to your computer and use it in GitHub Desktop.
Save umpirsky/1048888 to your computer and use it in GitHub Desktop.
PHP SOAP client for .NET SOAP server
<?php
class SoapClient extends \SoapClient {
function __doRequest($request, $location, $action, $version, $one_way = null) {
$headers = array(
'Method: POST',
'Connection: Close',
'User-Agent: PHP Soap Client',
'Content-Type: text/xml',
'SOAPAction: "' . $action . '"',
);
$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);
return $response;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment