Sam wsdl mi ladnie pobiera, dane autorazacji są ok. Niestety gdy probuje wywolac metode FindItem to pluje mi bledem 403
$action='http://schemas.microsoft.com/exchange/services/2006/messages/FindItem'; $headers = array( 'Method: POST', 'Connection: Keep-Alive', 'User-Agent: PHP-SOAP-CURL', 'Content-Type: text/xml; charset=utf-8', 'SOAPAction: "'.$action.'"', ); $ch = curl_init('https://www.outlook.com/EWS/Exchange.asmx'); $request = '<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/messages"><SOAP-ENV:Header><ns1:RequestServerVersion Version="Exchange2007"/></SOAP-ENV:Header><SOAP-ENV:Body><ns2:FindItem Traversal="Shallow"><ns2:ItemShape><ns1:BaseShape>Default</ns1:BaseShape></ns2:ItemShape><ns2:CalendarView StartDate="2012-06-12T15:18:34+03:00" EndDate="2014-06-12T15:18:34+03:00"/><ns2:ParentFolderIds><ns1:DistinguishedFolderId Id="calendar"/></ns2:ParentFolderIds></ns2:FindItem></SOAP-ENV:Body></SOAP-ENV:Envelope>'; curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POST, true ); curl_setopt($ch, CURLOPT_POSTFIELDS, $request); curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC | CURLAUTH_NTLM); curl_setopt($ch, CURLOPT_USERPWD, $user.':'.$password); //te zmienne sa poprawne $response = curl_exec($ch); echo 'res';var_dump($response); $i = curl_getinfo($ch); print_r($i);
A o to wynik:
Cytat
REQstring(0) ""
Array
(
[url] => https://www.outlook.com/EWS/Exchange.asmx
[content_type] =>
[http_code] => 403
[header_size] => 746
[request_size] => 2021
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 1
[total_time] => 3.178784
[namelookup_time] => 3.8E-5
[connect_time] => 4.0E-5
[pretransfer_time] => 0.000172
[size_upload] => 693
[size_download] => 0
[speed_download] => 0
[speed_upload] => 218
[download_content_length] => 0
[upload_content_length] => 693
[starttransfer_time] => 2.882555
[redirect_time] => 0.296186
[redirect_url] =>
[primary_ip] => .....
[certinfo] => Array
(
)
[primary_port] => 443
[local_ip] => ......
[local_port] => 58506
)
Array
(
[url] => https://www.outlook.com/EWS/Exchange.asmx
[content_type] =>
[http_code] => 403
[header_size] => 746
[request_size] => 2021
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 1
[total_time] => 3.178784
[namelookup_time] => 3.8E-5
[connect_time] => 4.0E-5
[pretransfer_time] => 0.000172
[size_upload] => 693
[size_download] => 0
[speed_download] => 0
[speed_upload] => 218
[download_content_length] => 0
[upload_content_length] => 693
[starttransfer_time] => 2.882555
[redirect_time] => 0.296186
[redirect_url] =>
[primary_ip] => .....
[certinfo] => Array
(
)
[primary_port] => 443
[local_ip] => ......
[local_port] => 58506
)