I'm using Office JavaScript API to edit and save emails through an Add-in.
To get all attachments of an email, I use makeEwsRequestAsync. Most of the time the method is successful but sometimes it returns this error:
Failed to make a request via HttpWebRequest.
Exception: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.
{
"value": null,
"status": "failed",
"error": {
"name": "GenericResponseError",
"message": "Failed to make a request via `HttpWebRequest`. Exception: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.",
"code ": 9020
}
}
I'm working with Outlook 2016 Online (Office 365 ProPlus Version 1711) and I got the error on Windows 10 machine using both Chrome and Edge browsers.
EDIT:
Here is the full scenario:
Create new email
Hit send button
Add-in will intercept send event
Add-in saves email under draft using Office.context.mailbox.item.saveAsync that will return itemId
Once itemId is returned, try to load email headers and attachments (in parallel) by calling two makeEwsRequestAsync methods (using itemId with properly formated XML)
I can only think about 3 issues:
Is it possible that saveAsync returns an itemId that does not exist yet?
But in this case, I'm expecting a different error message.
Does calling 2 makeEwsRequestAsync simultaneously is problematic?
I don't think so. JavaScript is single threaded and the 2 methods are never called at the same time.
Is there a session timeout to communicate with EWS API?
Also, The error happens in different mailboxes and there is no other prior or post error.
Related
I am facing an issue while attaching a file in my SMTP sampler.
Below are the steps performed:
1-Writing the Summary Report results into a file/folder i.e D:/ABC/XYZ${__time(ddMMyyhhmmss)}.csv (It successfully write on that path)
2-Attaching the same file i.e D:/ABC/XYZ${__time(ddMMyyhhmmss)}.csv in my SMTP sampler against Attach file(s) field.
Now I Execute my Script and got this error.
Response code:500 Response message: IOException while sending message
And after that, when I don't attach any file. My script runs successfully.
One more thing I want to add. Earlier to this script, I was able to send the attachments too but those were from my Gmail account added in SMTP. And now I am doing it from my company's email account i.e. using outlook in SMPT sampler.
Please guide me in resolving the said issue.
Your ${__time(ddMMyyhhmmss)} will generate different results each second:
so you most probably need to amend:
first usage as ${__time(ddMMyyhhmmss,timestamp)}, this way the first function call will store the generated value into timestamp JMeter Variable
second, third, etc. as ${timestamp}
Outlook is an application which can access multiple mailboxes using various protocols like SMTP, POP, IMAP or Microsoft Exchange. JMeter supports first 3, but if your company is using MS Exchange as email transport - you won't be able to use SMTP Sampler, you will have to switch to JSR223 Sampler and write your mail sending code in Groovy using library like javaxt-exchange or EWS Java API
I am building a slack app connected with a Symfony application that uses slash commands and dialogs as UI to create new users, accounts and projects and store them in a database.
I use a slash command to trigger a dialog with input fields and store the submitted data in a database, send a 'user successfully created' message to slack as well as a 200 response with an empty body, as described in the documentation.
However, when I fill in the input fields and press submit, I receive an error message with 'We had some trouble connecting. Try again?'. This error also prevents the dialog from closing.
The submitted data is still received correctly by my application and stored to the database and the 'user successfully created'-message is also send correctly to slack. So the whole process seems to work correctly, the only problem is that the dialog doesn't close and shows the error message.
I also tried to immediately send a http 200 response, without processing the submitted data first and this gives the same error message.
In Golang, the only thing that worked was responding with status 200 and empty body:
w.Write(nil).
I am not sure which lang are you using but try responding with an empty body.
Responding with 204 did not work for me.
I was developing a few Office Outlook Web Add-ins and in none of them could I receive an response error message. Independently of the error that API returns I receive the following data object in fail function:
readyState: 0
responseText: ""
status: 0
statusText: "error"
withCredentials: true
Moreover in the Visual Studio or Browser JavaScript Console console I get:
Origin https://localhost:44347 not found in Access-Control-Allow-Origin header.
XMLHttpRequest: Network Error 0x80700013, Could not complete the operation due to error 80700013.
I would like to point out that CORS is enabled on the server, and I got this error independently from the action taken. It is the same when I give wrong parameter or make a typo in url.
I would also like to point out that API is OK, and such a thing does not happen when I request using JS in the browser (out of Office) or applications. I get a normal error messages from the server then.
In the example above the test is from localhost, but exactly the same situation is when hosted on remote web server.
What is wired about this is that I normally get success replies (with code and message).
What I would like to achieve is to get an error response as the server returns them. It is really hard to notify user what may be wrong with his request without this info.
[Edit]
For example, when I do the following request in a Outlook Add-in and I set the fake token I receive the mentioned error (or rather no error):
$.ajax({
type: 'GET',
url: API_URL + "/api/rooms/",
beforeSend: function (xhr) {
$.ajaxSettings.beforeSend(xhr);
xhr.setRequestHeader("Authorization", "Bearer " + token);
},
contentType: "application/json",
});
However, when I do the save request using Advanced REST Client I got 403:
"description": "You do not have permission to perform this action.",
"message": "",
"code": "permission-denied",
"status": "fail"
It happens in all Outlook version for me.
The issue is that the office add-in is sending a request to your web application over HTTP and the web project that gets created (I'm assuming you're using the Office add-in templates from visual studio) is by default configured for SSL, i.e an HTTPS connection. Whilst this is recommended for production apps, for debugging purposes you can simply click on your web project, then in visual studio click view on the Menu Bar - > then select the properties window -> then set SSL enabled to false. (see attached Image)
https://i.stack.imgur.com/Lvybn.png
Hope this helps!
We have a mailapp addin implemented. We have encountered a strange error if we installed the addin in mailbox, which is in Excahnge 2016. There is some problem with EWS requet. We are using office.js to make request to exchange 2016.
makeEwsRequestAsync(data, callback, [userContext])
The above method is used to communicate with exchange. So if mailapp is installed on Exchange 2016 and we request some additional properties from email via above function we receive an asyncResult object with error:
error code: 9020
message: Remote server returned an error: (401 Unauthorized)
In documentation there is a note that in exchange the OAuth should be enabled.
NOTE: The server administrator must set OAuthAuthentication to true on the Client Access Server EWS directory to enable the makeEwsRequestAsync method to make EWS requests
We have checked this setting and it is set up. What else should we check? Any suggestion?
Please find update download here: https://technet.microsoft.com/en-us/library/jj907309(v=exchg.160).aspx
I am using google location autocomplete at aws server its not working and the same code i am using on another server its working fine you can check here AWS==> http://52.91.226.167/testgeo.php other server==>http://142.4.10.93/~vooap/alcohol/test.php geocomplete needs any server side setting ?
You should use a valid API key as mentionned in the message received when the autocomplete message is sent:
You can see this message under Network panel in developer console. Each time you hit a key in the input, an ajax request is sent and you receive this message.