I'm attempting to build a custom extension to handle all the calls and connection to Nylas, a third-party email services provider. I've created the action and I'm even able to run a unit test in Visual Studio, but when I try adding the action into a server action in my app, it never gets called. I watch the debugger land on the action, and then eventually the screen shows a connection timeout error, and no log is added to service center for the extension. I've rebuilt the extension twice now, and still no luck. Thoughts?
Hi @Daniel Johnson
This scenario may be caused due to a exception happening inside the code.
Use a exception handling scenario in the code and audit the same using the below code. This can give you an idea on what the parameter passed, action taken and error raised in the function.
GenericExtendedActions.LogMessage(AppInfo.GetAppInfo().OsContext, <Message>, <Module Name>);
Thanks @Jerome Rajadurai J, that was a good suggestion, and it is working to get the logs into Service Center as I'm attempting to log each step. But the trail still goes cold once the API request is made. I can see in the logs that the request is being sent, or attempting to be sent, but then nothing else happens and the screen returns a connection timeout error.
Is it possible that the request is being stopped by the OutSystems server? I've opened a support ticket and asked just that.
It looks like your extension is unable to reach the Nylas server. btw is there a IP filter at Nylas end which prevents connection from OutSystems server end ?
That's a good question, because it's returning successful results in Postman and when I run the unit test locally. I've just recreated the API method the normal way in Service Studio, and similarly it is working when I test the API request from within Service Studio but not working when I try using it in the application. I guess the test feature for APIs in Service Studio opens the connection from my machine and not from the OutSystems server? I'm getting a 401 Unauthorized error when I try using it in the app, and in Service Center there's no trace data.
@Siya if Nylas asks me for domains to add to their whitelist, would I give them my environment domains or are the API calls generating from somewhere else in the OutSystems realm?
When you test the API from Service Studio, it communicates with the Platform Server, not directly from Service Studio. By the way, you mentioned that you have created a .NET extension. Why can't we use the consume REST method directly instead of extension? You can enable the Full Logging and see the what data is communicated with the server.
for getting the IP address of your server please follow the steps given at https://www.outsystems.com/forums/discussion/95674/using-the-built-in-email-facility-what-mta-is-used/
Hi @Daniel Johnson ,
Ok, I understand the issue now. The SDK is trying to access the API and it seems to be unreachable because of the connection being blacklisted by default for some IP range. Please raise a support ticket for your environment and ask them to whitelist the same (or a lifetime IP filtering entry to be added).
Thanks.