note 105194 added to soapclient.soapclient
| From: | gcleaves at gcleaves dot com | Date: | Tue, 02 Aug 2011 13:55:27 +0000 |
| Subject: | note 105194 added to soapclient.soapclient | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-182101@lists.php.net to get a copy of this message | ||
I was able to connect to SharePoint web services with NTLM by following these instructions:
http://www.php.net/manual/en/soapclient.soapclient.php#97029
http://davidsit.wordpress.com/2010/02/23/reading-a-sharepoint-list-with-php/
However, I needed modify the callCurl function from the first link above to look like this:
<?php
protected function callCurl($url, $data) {
$handle = curl_init();
curl_setopt($handle, CURLOPT_HEADER, false);
curl_setopt($handle, CURLOPT_URL, $url);
curl_setopt($handle, CURLOPT_FAILONERROR, true);
curl_setopt($handle, CURLOPT_HTTPHEADER, Array('Content-type: text/xml',"PHP
SOAP-NTLM Client") );
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handle, CURLOPT_POSTFIELDS, $data);
curl_setopt($handle, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
curl_setopt($handle, CURLOPT_USERPWD, 'xyz:123');
//curl_setopt($handle,
CURLOPT_PROXYUSERPWD,$this->proxy_login.':'.$this->proxy_password);
//curl_setopt($handle, CURLOPT_PROXY, $this->proxy_host.':'.$this->proxy_port);
//curl_setopt($handle, CURLOPT_PROXYAUTH, CURLAUTH_NTLM);
$response = curl_exec($handle);
if (empty($response)) {
throw new
SoapFault($url.':'.$this->proxy_login.':'.$this->proxy_password.' -
CURL error: '.curl_error($handle),curl_errno($handle));
}
curl_close($handle);
return $response;
}
?>
Instead of doing NTLM for proxy authentication, we use NTML for HTTP authentication. But you still
need to store the WSDL file locally as per the second link's instructions.
----
Server IP: 69.147.83.197
Probable Submitter: 77.240.126.30
----
Manual Page -- http://www.php.net/manual/en/soapclient.soapclient.php
Edit -- https://master.php.net/note/edit/105194
Del: integrated -- https://master.php.net/note/delete/105194/integrated
Del: useless -- https://master.php.net/note/delete/105194/useless
Del: bad code -- https://master.php.net/note/delete/105194/bad+code
Del: spam -- https://master.php.net/note/delete/105194/spam
Del: non-english -- https://master.php.net/note/delete/105194/non-english
Del: in docs -- https://master.php.net/note/delete/105194/in+docs
Del: other reasons-- https://master.php.net/note/delete/105194
Reject -- https://master.php.net/note/reject/105194
Search -- https://master.php.net/manage/user-notes.php