diff options
author | arron.woods <arron.woods@deae1e92-32f9-c189-e222-5b9b5081a27a> | 2011-03-11 18:14:12 +0000 |
---|---|---|
committer | arron.woods <arron.woods@deae1e92-32f9-c189-e222-5b9b5081a27a> | 2011-03-11 18:14:12 +0000 |
commit | 8fbc17b817a432d985c5e2976218d98c56c05845 (patch) | |
tree | c2e8d870ea6c1e2683b0a38912cd548a4075ade7 | |
parent | 12645bd58af7053ea192ee30f453c0a94f05a211 (diff) | |
download | php-ssrs-8fbc17b817a432d985c5e2976218d98c56c05845.zip php-ssrs-8fbc17b817a432d985c5e2976218d98c56c05845.tar.gz php-ssrs-8fbc17b817a432d985c5e2976218d98c56c05845.tar.bz2 |
NTLM Curl tests for HTTP_CODE 200
-rwxr-xr-x | library/SSRS/Object/CatalogItems.php | 3 | ||||
-rwxr-xr-x | library/SSRS/Soap/NTLM.php | 11 |
2 files changed, 11 insertions, 3 deletions
diff --git a/library/SSRS/Object/CatalogItems.php b/library/SSRS/Object/CatalogItems.php index c68a964..ac16f77 100755 --- a/library/SSRS/Object/CatalogItems.php +++ b/library/SSRS/Object/CatalogItems.php @@ -5,6 +5,9 @@ * * @author arron */ + +require_once('ArrayIterator.php'); + class SSRS_Object_CatalogItems extends SSRS_Object_ArrayIterator { public $iteratorKey = 'CatalogItems'; diff --git a/library/SSRS/Soap/NTLM.php b/library/SSRS/Soap/NTLM.php index 951b14b..32c9ff1 100755 --- a/library/SSRS/Soap/NTLM.php +++ b/library/SSRS/Soap/NTLM.php @@ -143,10 +143,15 @@ class SSRS_Soap_NTLM extends SoapClient { curl_setopt($handle, CURLOPT_POSTFIELDS, $data); } - $response = curl_exec($handle); - if (empty($response)) { + $response = curl_exec($handle); + if($response === false) { throw new SSRS_Soap_Exception('CURL error: ' . curl_error($handle), curl_errno($handle)); } + + $httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE); + if ($httpCode !== 200){ + throw new SSRS_Soap_Exception('HTTP error: ' . $httpCode); + } curl_close($handle); $this->_lastResponse = (string) $response; @@ -161,4 +166,4 @@ class SSRS_Soap_NTLM extends SoapClient { return $this->_lastResponse; } -}
\ No newline at end of file +} |