jamesiarmes / php-ews

PHP Exchange Web Services
http://jamesarmes.com/php-ews/
MIT License
566 stars 303 forks source link

SOAP client returned status of 404. #417

Open Zonork opened 7 years ago

Zonork commented 7 years ago

Version (e.g. 1.0, dev-master): 1.0 PHP version: 7.0 Microsoft Exchange version: 2016

Description of problem:

SOAP client returned status of 404.

I have this problem when i´m trying to get a message by the message Id.

I'm using your "get-attachments" example, but always get a "SOAP client returned status of 404.".

In the example you have:

$message_id = 'AAMkADk0N2E4OTQxLWRlOTYtNGUxZC05NzE1LTU4ZmI5NGVkZTZmYQBGAAAAAADeofKHfJ96S5ndHNLg9VfeBwAr1MfeoTJdQ7jgaw/bSgljAAAAAAEMAAAr1MfeoTJdQ7jgaw/bSgljAABlQRSTAAA=';

$item = new ItemIdType();
$item->Id = $message_id;

I´m using "$client->FindItem($request);" to get a list of messages, from that list a get the message_id and when try to get the message i got an 404 error.

I'll try to construct the ItemType with the complete info:

$item = new ItemIdType();
$item->ChangeKey = 'Message_itemId_ChangeKey';
$item->Id = 'Message_itemId_id';

But still getting 404 error.

Thanks

Additional details:

Another thing is when i get the message list with "$client->FindItem($request)", in the message object has "+HasAttachments: true" but, "+Attachments: null" and " +Body: null"..

jamesiarmes commented 7 years ago

If you're receiving a 404, that would indicate that your Exchange server's SOAP service couldn't be found. It should be accessable at https://HOST_NAME/EWS/Exchange.asmx. If your FindItem request is working, please verify that the server hostname you are passing to the client in the get-attachments example matches.