jasonramsden / php-ews

Automatically exported from code.google.com/p/php-ews
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Missing RequestServerVersion SOAP header #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. FindFolder request with DistinguishedFolderId on publicfoldersroot and
Traversal on Shallow.

Expected output: succesful response

Got soap error: 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.

Quick fix: to NTMLSOAPClient_Exchange::__construct(), I added this:

$soapHeader = new SoapHeader(
    'http://schemas.microsoft.com/exchange/services/2006/types',
    'RequestServerVersion Version="Exchange2007_SP1"'
);
$this->__setSoapHeaders($soapHeader);

Obviously, the Exchange2007_SP1 part should be configurable. 

Original issue reported on code.google.com by kristof.coomans on 23 Apr 2010 at 10:13

GoogleCodeExporter commented 9 years ago
I find it odd that I haven't run into this issue before. I will verify that 
this is 
all that is required and take care of it this weekend.

Original comment by JamesIArmes@gmail.com on 23 Apr 2010 at 11:50

GoogleCodeExporter commented 9 years ago
Ah, this fix may work with the ExchangeImpersonation, however i'm unsure, how 
to 
impliment this on  NTLMSoapClient_Exchange , any thoughts

Original comment by gore...@gmail.com on 6 Jun 2010 at 5:37

GoogleCodeExporter commented 9 years ago
Hi, I've attached a patch that fixes this issue (we were affected as well.)

Original comment by jon.klos...@gmail.com on 30 Aug 2011 at 4:58

Attachments:

GoogleCodeExporter commented 9 years ago
forgot to mention, to use the new code you need to specify the new optional 
exchange server version parameter to the ExchangewWebServices constructor, like 
so:

$ews = new ExchangeWebServices('server', 'username', 'password', 
EWSType_ExchangeVersionType::Exchange2007_SP1);

Original comment by jon.klos...@gmail.com on 30 Aug 2011 at 5:00

GoogleCodeExporter commented 9 years ago
This has been merged into the master branch. I made some changes to your patch, 
the biggest change being that I added the constants directly to the 
ExchangeWebServices class rather than adding a new class. I have also added you 
to the contributors file, thank you for your contribution.

Original comment by JamesIArmes@gmail.com on 30 Sep 2011 at 2:52

GoogleCodeExporter commented 9 years ago
This issue has been moved to GitHub 
https://github.com/jamesiarmes/php-ews/issues/3

Original comment by JamesIArmes@gmail.com on 14 Feb 2012 at 2:10