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

Exchange2019 Version 15.2 ‎(Build 858.5)‎ return ErrorInvalidRequest #927

Closed
lchen016 opened this issue Jun 2, 2021 · 6 comments
Closed

Comments

@lchen016
Copy link

lchen016 commented Jun 2, 2021

We updated our Exchange server from 2016 to 2019. When our EWS client try to connect to the server with RequestServerVersion Version="Exchange2019", the server returns 500 ErrorInvalidRequest. If we change to rise Version="Exchange2016", the same server returns 200

EWS Request:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">soap:Header<t:RequestServerVersion Version="Exchange2019"></t:RequestServerVersion></soap:Header>soap:Body<m:GetFolder><m:FolderShape><t:BaseShape>AllProperties</t:BaseShape></m:FolderShape><m:FolderIds><t:DistinguishedFolderId Id="inbox"></t:DistinguishedFolderId></m:FolderIds></m:GetFolder></soap:Body>
</soap:Envelope>

Response from Exchange2019 server:

<s:Body><s:Fault>a:ErrorInvalidRequestThe request is invalid.<e:ResponseCode xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">ErrorInvalidRequest</e:ResponseCode><e:Message xmlns:e="http://schemas.microsoft.com/exchange/services/2006/errors">The request is invalid.</e:Message></s:Fault></s:Body></s:Envelope>

Using Exchange2016 in the request to the same Exchange2019 server
Request

AllProperties

Response:

NoError

<m:Folders><t:Folder><t:FolderId Id="AQMkADY2AGY4ZGY0Zi05YTNlLTRiY......"/><t:ParentFolderId Id="AQMkADY2AGY4ZGY0Zi........." ChangeKey="AQ......"/><t:FolderClass>IPF.Note</t:FolderClass><t:DisplayName>Inbox</t:DisplayName><t:TotalCount>0</t:TotalCount><t:ChildFolderCount>0</t:ChildFolderCount><t:EffectiveRights><t:CreateAssociated>true</t:CreateAssociated><t:CreateContents>true</t:CreateContents><t:CreateHierarchy>true</t:CreateHierarchy><t:Delete>true</t:Delete><t:Modify>true</t:Modify><t:Read>true</t:Read><t:ViewPrivateItems>true</t:ViewPrivateItems></t:EffectiveRights><t:UnreadCount>0</t:UnreadCount></t:Folder></m:Folders>
</m:GetFolderResponseMessage></m:ResponseMessages></m:GetFolderResponse></s:Body></s:Envelope>

Expected behavior
We expect when using the version Exchange2019 to connect to the Exchange2019 server, it should not return an error.
And also expect to know the reason why using version ="Exchange2016" can work with the same Exchange2019 server without error.

@ecederstrand
Copy link
Owner

While Exchange 2019 has been released, its EWS API apparently still identifies as Exchange2016. exchangelib will auto-negotiate the version, so it’s not a huge problem.

@lchen016
Copy link
Author

lchen016 commented Jun 2, 2021

Will this behavior being corrected in the future or is using version="Exchange2016" for Exchange2019 is expected?

@ecederstrand
Copy link
Owner

Frankly, I don’t know what Microsoft intend to do here. Does it cause problems for you in exchangelib?

@lchen016
Copy link
Author

lchen016 commented Jun 2, 2021

Things seem to work if we use version="Exchange2016" and even version="Exchange2010".

@ecederstrand
Copy link
Owner

ecederstrand commented Jun 2, 2021

I meant problems in terms of exceptions, stack traces etc. A single unnecessary request isn’t likely to cause real problems, as I see it. And you can always explicitly set the version to Exchange2016 in your Configuration if you want to avoid it.

@ecederstrand
Copy link
Owner

I’m closing this issue because I don’t see any actual problems in terms of exceptions, bugs or performance issues. Feel free to reopen if you disagree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants