Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing RequestServerVersion SOAP header #3

Closed
jamesiarmes opened this issue Jan 9, 2012 · 5 comments
Closed

Missing RequestServerVersion SOAP header #3

jamesiarmes opened this issue Jan 9, 2012 · 5 comments
Assignees

Comments

@jamesiarmes
Copy link
Owner

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:

<?php
$soapHeader = new SoapHeader(
    '<a href="http://schemas.microsoft.com/exchange/services/2006/types'" rel="nofollow">http://schemas.microsoft.com/exchange/services/2006/types'</a>,
    'RequestServerVersion Version=&quot;Exchange2007_SP1&quot;'
);
$this-&gt;__setSoapHeaders($soapHeader);

Obviously, the Exchange2007_SP1 part should be configurable.

Originally posted by kristof.coomans on Google Code: http://code.google.com/p/php-ews/issues/detail?id=3

jamesiarmes added a commit that referenced this issue Jan 9, 2012
…he ExchangeWebServices class and passing it in as an option to the SOAP client.
jamesiarmes added a commit that referenced this issue Jan 9, 2012
…::__construct() to handle the version property and set it as a SOAP header.
@jamesiarmes
Copy link
Owner Author

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.

Originally posted by jamesiarmes on Google Code: http://code.google.com/p/php-ews/issues/detail?id=3#c1

@ghost ghost assigned jamesiarmes Feb 14, 2012
@jamesiarmes
Copy link
Owner Author

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

Originally posted by goresci on Google Code: http://code.google.com/p/php-ews/issues/detail?id=3#c2

@jamesiarmes
Copy link
Owner Author

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

Originally posted by jon.kloske.uq on Google Code: http://code.google.com/p/php-ews/issues/detail?id=3#c3
File attached: php-ews_issue3_fix.diff

@jamesiarmes
Copy link
Owner Author

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:

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

Originally posted by jon.kloske.uq on Google Code: http://code.google.com/p/php-ews/issues/detail?id=3#c4

@jamesiarmes
Copy link
Owner Author

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.

Originally posted by jamesiarmes on Google Code: http://code.google.com/p/php-ews/issues/detail?id=3#c5

@j-d j-d mentioned this issue Jul 18, 2012
alasdaircr pushed a commit to alasdaircr/php-ews that referenced this issue Jan 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant