Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Pobranie kalendarzy z exchange
nospor
post 4.12.2013, 15:35:42
Post #1





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Hej, prubuje pobrac kalendarze z exchange.
Sam wsdl mi ladnie pobiera, dane autorazacji są ok. Niestety gdy probuje wywolac metode FindItem to pluje mi bledem 403
  1.  
  2. $action='http://schemas.microsoft.com/exchange/services/2006/messages/FindItem';
  3. $headers = array(
  4. 'Method: POST',
  5. 'Connection: Keep-Alive',
  6. 'User-Agent: PHP-SOAP-CURL',
  7. 'Content-Type: text/xml; charset=utf-8',
  8. 'SOAPAction: "'.$action.'"',
  9. );
  10.  
  11. $ch = curl_init('https://www.outlook.com/EWS/Exchange.asmx');
  12.  
  13. $request = '<?xml version="1.0" encoding="UTF-8"?>
  14. <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>';
  15.  
  16. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  17. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  18. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  19. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  20. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  21. curl_setopt($ch, CURLOPT_POST, true );
  22. curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
  23. curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
  24. curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC | CURLAUTH_NTLM);
  25. curl_setopt($ch, CURLOPT_USERPWD, $user.':'.$password); //te zmienne sa poprawne
  26.  
  27. $response = curl_exec($ch);
  28. echo 'res';var_dump($response);
  29. $i = curl_getinfo($ch);
  30. 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
)
Powód edycji: [nospor]:


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 9)
Pyton_000
post 4.12.2013, 21:37:35
Post #2





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

Ostrzeżenie: (0%)
-----


FindItems questionmark.gif

Ten post edytował Pyton_000 4.12.2013, 21:37:56
Go to the top of the page
+Quote Post
nospor
post 5.12.2013, 08:42:41
Post #3





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Hmm.... czemu uwazasz ze powinno tam byc FindItems a nie FindItem?
wsdl exchenga wyraźnie mowi o FindItem a nie FindItems

Tak czy siak dodanie 's' nic nie zmienia (procz faktu ze pluje bledem ze nie ma FindItems wink.gif )


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
Pyton_000
post 5.12.2013, 18:56:46
Post #4





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

Ostrzeżenie: (0%)
-----


Heheh w dokumentacji mi się rzuciło w oczy smile.gif Ale może była lipna bo od MS haha.gif

Tak na poważnie...
Może to Ci coś pomoże (pewnie już widziałeś smile.gif )
http://www.howtoforge.com/talking-soap-with-exchange
Go to the top of the page
+Quote Post
nospor
post 6.12.2013, 13:19:48
Post #5





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Podany przez Ciebie link sprowadza sie do tego samego co juz mam sad.gif


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
com
post 6.12.2013, 13:27:49
Post #6





Grupa: Zarejestrowani
Postów: 3 034
Pomógł: 366
Dołączył: 24.05.2012

Ostrzeżenie: (0%)
-----


Na http://schemas.microsoft.com/exchange/serv...ssages/FindItem jest taki komunikat:
Cytat
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

http://forums.asp.net/t/1525194.aspx
wiec może to przez to...
Go to the top of the page
+Quote Post
nospor
post 6.12.2013, 13:37:38
Post #7





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Tak, ale to jest schema podawana przez WSDL exchenga.


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
com
post 6.12.2013, 13:39:31
Post #8





Grupa: Zarejestrowani
Postów: 3 034
Pomógł: 366
Dołączył: 24.05.2012

Ostrzeżenie: (0%)
-----


no zgadza sie ale być może, przez to, że jej nie nie widzi, nie chce Cie wpuścić wink.gif
Go to the top of the page
+Quote Post
nospor
post 6.12.2013, 13:41:36
Post #9





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Wiesz, wcale by mnie to nie zdziwilo.... Ale nie sądze ze to w tym jest problem w tym przypadku, choc znam sie akurat na tym jak na promach kosmicznych, wiec kto wie wink.gif


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
com
post 6.12.2013, 13:44:16
Post #10





Grupa: Zarejestrowani
Postów: 3 034
Pomógł: 366
Dołączył: 24.05.2012

Ostrzeżenie: (0%)
-----


no ja też niestety z tym nigdy nie pracowałem, ale jakiś cel wysyłania go z tym schema jest wiec to jedyne co mi przyszło na myśl...
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 22.06.2025 - 18:34