Talking to Exchange with SOAP

Discussion in 'HOWTO-Related Questions' started by rj_mayer, Dec 2, 2009.

  1. rj_mayer

    rj_mayer New Member

    I am writing from a school in Cambridgeshire, UK.

    With reference to the guidance given here:

    My aim in this exercise is two fold:

    To address Public Folder Calendars and extract items from there for caching into a database and subsequent use on websites/intranets.

    To address user accounts and prepopulate their calendars with timetable information extracted from other sources.

    I have successfully got a SOAP request talking to the remote Exchange 2007 box using the PHP classes provided - thank for that. I have been able to talk to the account that the credentials are given for and pull out calendar data.

    The help I would like is to be given an example of how to set up a SOAP request (preferably in terms of the PHP class mentioned above) to access a Public Folder Calendar and to address another user's Mail Box which the authenticating user has rights to.

    After researching through the TechNet website for Public Folder connectivity examples, I have tried the following request for publicfoldersroot:

    $FindItem->ParentFolderIds->DistinguishedFolderId->Id = "publicfoldersroot";

    ... and I get the following error, which is different to the 'this request is built incorrectly'-type errors, which makes me think I'm going along the right lines:

    Fatal error: Uncaught SoapFault exception: [soap11:Client] The request is valid but does not specify the correct server version in the RequestServerVersion SOAP header. Ensure that the RequestServerVersion SOAP header is set with the correct RequestServerVersionValue. in D:\www\admin\dev\cambsed\cambsed.php:175 Stack trace: #0 [internal function]: SoapClient->__call('FindItem', Array) #1 D:\www\admin\dev\cambsed\cambsed.php(175): ExchangeNTLMSoapClient->FindItem(Object(stdClass)) #2 {main} thrown in D:\www\admin\dev\cambsed\cambsed.php on line 175

    Any help much appreciated.
  2. aschults

    aschults New Member

    RequestServerVersion in SOAP Headers

    Hi rj_major,

    After some experimenting this worked for me:

    new SOAPHeader('',

    $client is the SoapClient Instance.

    I first tried with a similar Version string and got this one back from the Exchange server in an error message.

  3. feuxx

    feuxx New Member

    Help me to scann Inbox


    I come to you because I have a small problem that is becoming urgent, for one of my projects at work.

    I'm stuck and it becomes very urgent, I seek the way to list all emails from my inbox from a primary Exchange server and read its contents and headers ,....

    I use the EWS class with a LDAP connection, I can send emails, in listing of Calendar event, to enter the Inbox (or so I think :)).

    Could you please help me

Share This Page