Views:

Applies to Product - Dynamics 365 Supply Chain Management


What’s happening?
The customer is experiencing a CORS policy error when attempting to consume a web service from Dynamics 365 FO using an Angular client application. The error message indicates that access to XMLHttpRequest has been blocked due to the absence of the 'Access-Control-Allow-Origin' header in the server response.
 

Reason:
The underlying cause of this is identified as the absence of the 'Access-Control-Allow-Origin' header in the server response, which is necessary for cross-origin requests.
 

Resolution:

  • Verify that the certificates used are valid and not expired, as this has been a common cause of similar issues.
  • Ensure that the Angular application is configured correctly to handle CORS requests. Specifically, check that the appropriate CORS headers are included in the server responses.
  • The key header that must be included is 'Access-Control-Allow-Origin', which should allow the origin of the Angular application.
  • If the issue persists, consider investigating additional solutions such as adding headers or using a proxy in the Angular HTTP request.