Fix Invalid Request Errors with makeEwsRequestAsync in Outlook Add-ins
Question details
The user needs to fix an "Invalid request" error that occurs when calling the Office.context.mailbox.makeEwsRequestAsync method with a SOAP XML payload.

- Product
- Microsoft Outlook Add-ins
- Device & OS
- not provided
- Scenario
- Developing or debugging an Outlook add-in that attempts to retrieve Exchange data using an EWS SOAP request.
- Observed behavior
- The makeEwsRequestAsync method fails and returns an "Invalid request" error, even when the user believes the XML request matches official documentation.
Ensure you have access to the browser console or the add-in debugger to inspect the exact network request and error logs generated by your Outlook add-in.
Validate Outlook Add-in Context and EWS XML Schema
Use this solution to ensure your code is running in the correct environment and that your SOAP request exactly matches the Exchange Web Services (EWS) requirements.
The makeEwsRequestAsync method is highly sensitive to XML formatting. Even a minor typo in the EWS namespace, missing property elements, or executing the script outside of the strict Outlook mailbox context will trigger an invalid request error.
Ensure your script is exclusively running inside an Outlook add-in. The method is invoked via Office.context.mailbox; check that this object is fully defined before calling makeEwsRequestAsync.
Check your raw XML request string. Ensure it is a well-formed SOAP envelope and that you have included the correct EWS namespaces (e.g., http://schemas.microsoft.com/exchange/services/2006/messages).
If you are using the GetFolder operation, verify that the folder identifier and property elements strictly match Microsoft's published GetFolder operation EWS schema.
Open the F12 developer tools in your browser (or use the desktop add-in debugger) to view the console. Inspect the actual payload sent and any detailed error codes returned by the Exchange server.

Try WPS Office for Your Document and Productivity Needs
While debugging complex Exchange Web Services and Outlook add-ins, you may also need a reliable, fast, and free office suite for your daily documentation. WPS Office provides exceptional compatibility with Microsoft formats in a lightweight package.
- 1. Download WPS Office: Visit the official WPS website and download the free installer for your operating system.
- 2. Install and Launch: Run the lightweight installer. WPS Office will be ready to use in seconds.
- 3. Open Your Documents: Directly open your existing .docx, .xlsx, and .pptx files without worrying about formatting issues.

Frequently Asked Questions
Why does makeEwsRequestAsync throw an Invalid Request error?
This error is typically caused by malformed SOAP XML, incorrect or missing EWS namespaces, invalid folder identifiers, or attempting to run the code outside of an authorized Outlook add-in context.
Can I use makeEwsRequestAsync in Excel or Word add-ins?
No. The Office.context.mailbox.makeEwsRequestAsync method is exclusively designed for Exchange Web Services and is only available within Outlook add-ins.
How do I debug the XML payload sent by makeEwsRequestAsync?
You can debug the payload by running your Outlook add-in in a web browser and using the F12 developer tools. Check the 'Network' or 'Console' tabs to inspect the exact SOAP XML being dispatched and the server's detailed response.




