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

"The request is invalid" error if ExchangeVersion is set to V2018_01_08 #441

Open
bladerunner2020 opened this issue Jul 20, 2024 · 2 comments

Comments

@bladerunner2020
Copy link

bladerunner2020 commented Jul 20, 2024

I am not sure if it is issue of ews-javascript-api or ews itself.
The customer has Exchange2019 and we tried to set exchange version to V2018_01_08.
We got error this:

  Body: {
    __prefix: 's',
    Fault: {
      __prefix: 's',
      faultcode: 'a:ErrorInvalidRequest',
      faultstring: { 'xml:lang': 'ru-RU', faultstring: 'The request is invalid.' },
      detail: {
        ResponseCode: 'ErrorInvalidRequest',
        Message: 'The request is invalid.'
      }
    }
  }

The soap request was:

  <soap:Header>
    <t:RequestServerVersion Version="V2018_01_08"></t:RequestServerVersion>
  </soap:Header>
  <soap:Body>
    <m:FindItem Traversal="Shallow">
      <m:ItemShape>
        <t:BaseShape>IdOnly</t:BaseShape>
        <t:AdditionalProperties>
          <t:FieldURI FieldURI="calendar:AppointmentState"></t:FieldURI>
        </t:AdditionalProperties>
      </m:ItemShape>
      <m:CalendarView MaxEntriesReturned="1000" StartDate="2024-06-16T21:00:00.000Z"
        EndDate="2024-06-26T21:00:00.000Z"></m:CalendarView>
      <m:ParentFolderIds>
        <t:DistinguishedFolderId Id="calendar">
          <t:Mailbox>
            <t:EmailAddress>[email protected]</t:EmailAddress>
          </t:Mailbox>
        </t:DistinguishedFolderId>
      </m:ParentFolderIds>
    </m:FindItem>
  </soap:Body>
</soap:Envelope>

We found out that everything works fine if we set ExchangeVersion to Exchange2016.
I found a discussion on GitHub where there discussed a similar issue: ecederstrand/exchangelib#927

ews-javascript-api - v0.12.0

@gautamsi
Copy link
Owner

this probably is the problem with exchange, if you are able to work with 2016, it should be used. any higher version number in the EWS does not provide any new feature as Microsoft has stopped working on them presumably.

@bladerunner2020
Copy link
Author

this probably is the problem with exchange, if you are able to work with 2016, it should be used. any higher version number in the EWS does not provide any new feature as Microsoft has stopped working on them presumably.

I agree. I added this comment just to make this issue and solution findable here ))
Maybe it would be a good idea to put this into documentation as it's not obvious at all...

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