logo
search
Exchange Connection Problems

Fix Invalid Request Errors with makeEwsRequestAsync in Outlook Add-ins

Camila MilosovichCamila Milosovich Oct 21, 2026 869 views

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.

Fix Invalid Request Errors with makeEwsRequestAsync in Outlook Add-ins
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.
Before you start

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.

Solution 1Recommended

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.

1
Verify Add-in Environment Context

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.

2
Validate SOAP XML Formatting

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).

3
Inspect GetFolder Identifiers

If you are using the GetFolder operation, verify that the folder identifier and property elements strictly match Microsoft's published GetFolder operation EWS schema.

4
Review Browser Console and Logs

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.

Validate Outlook Add-in Context and EWS XML Schema
Reference Official EWS Documentation: Always compare your XML request side-by-side with the official Microsoft GetFolder operation documentation to spot missing or deprecated XML nodes.
Free Microsoft Office alternative

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. 1. Download WPS Office: Visit the official WPS website and download the free installer for your operating system.
  2. 2. Install and Launch: Run the lightweight installer. WPS Office will be ready to use in seconds.
  3. 3. Open Your Documents: Directly open your existing .docx, .xlsx, and .pptx files without worrying about formatting issues.
Fully compatible with Microsoft Word, Excel, and PowerPoint file formats.Lightweight installation with incredibly fast startup times.Completely free to use with a clean, familiar tabbed interface.Seamless cross-platform support for Windows, Mac, Linux, and mobile.
QA img-9

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.