Get Exchange Mail Message Activity Throws "An Element Node 'Soap:Header' Of The Type Element Was Expected, But Node 's:Body' Of Type Element Was Found"

How to troubleshoot an error ("An element node 'soap:Header' of the type Element was expected, but node 's:Body' of type Element was found.") when trying to get email from the Exchange server?

Root Cause: Exchange server database cache.

Troubleshooting Steps:

  • Since the error message is more specific to the Exchange server or it is related configurations, verify if possible to send or get email message programmatically via other apps than UiPath activities or through C#, VB.Net code snippets. Would suggest enabling request tracing to review how the actual request and responses look like. [Refer the post - Trace requests and responses to troubleshoot EWS Managed API apps ]
  • Validate if the error disappears when testing the mail activity against another / different exchange mail server
  • Verify if the mail activity configurations like server details, credentials, etc.., are valid.