I have simple requirement here to fetch data from Exchange Online EWS API & SharePoint lists and display those data onto HTML page of Apps for Office. This office app should work on OWA (Web mail) as well as Outlook client. I was able to see the response data in browser (OWA - Web mail), but when I am trying to load the same add-in on outlook client it doesn't show the data and gives the error in errorMessage
as:
No Transport
So, we did try enabling the CORS using $.support.cors = true
as per this thread, but no luck with that and got Access Denied error.
Does anyone have found the solution for this kind of scenario. Any help would be much appreciated.
Below is code snippet where I am getting that error:
$.ajax({
url: "https://myazuretenant.azurewebsites.net/GetData.asmx/GetLocations",
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
// Data Manipulation goes here
},
error: function (data, errorCode, errorMessage) {
app.showNotification('Error: ' + errorCode + ' - ' + errorMessage);
}
});
Note: Ajax request is going through the generic Web API (ASMX Service), which fetches the data using ExchangeService
library (EWS API) and SharePoint.