internal error in iframe cause by specific method

I have developed a traditional web app to be imbedded into another non-outsystems webpage. 

I am having 2 main issues which are 

at first the webpage would not load and give me an internal error but by disabling some methods I've narrowed the issue down to one REST API method and once I disabled said method the page loads just fine.

my second issue which us similar is when I try to change the language using SetCurrentLocale instead of it switching it'll give me internal error.

both are using session variables but so are some other methods that aren't causing any issues. 

The page is working completely fine when run separately not in the iframe. but once it is iframed the problem rises.

the webpage the iframe is is a different domain and is not an Outsystems developed page 



Hi Joharah,

What exactly are your questions? An iframe is running client-side, so there is, as far as I can see, no reason why a REST service, which is called from the server, would fail in an iframe but not without the iframe. Did you check whether the app runs if it's not inside an iframe?

Secondly, SetCurrentLocale cannot cause an error, so it must be in the code surrounding it. Did you check the error logging in Service Center? There's no such thing as an "internal error", when you see this it just means there's been an exception without exception handling. You need to consult the error loging to see what went really wrong (also for the REST error).

Kilian Hekhuis wrote:

Hi Joharah,

What exactly are your questions? An iframe is running client-side, so there is, as far as I can see, no reason why a REST service, which is called from the server, would fail in an iframe but not without the iframe. Did you check whether the app runs if it's not inside an iframe?

Secondly, SetCurrentLocale cannot cause an error, so it must be in the code surrounding it. Did you check the error logging in Service Center? There's no such thing as an "internal error", when you see this it just means there's been an exception without exception handling. You need to consult the error loging to see what went really wrong (also for the REST error).

 

 Hello Kilian,

Sorry for the late reply! yes when run outside of the iframe it works fine. the method i'm having issues with is a method in my call back page were it passes specific parameters to get an access token to use on  other endpoints. when running the page in the iframe I get there errors in my log 


500 Internal Server Error
   at ssReports_IS.Ccportal.ActionPostToken(HeContext heContext, ICcportalCallbacks _callbacks, String inParamContentType, String inParamcode, String inParamclient_id, String inParamclient_secret, String inParamredirect_uri, String inParamgrant_type, STPostTokenResponseStructure& outParamResponse)


500 Internal Server Error
at ssReports_IS.Ccportal.ActionPostToken(HeContext heContext, ICcportalCallbacks _callbacks, String inParamContentType, String inParamcode, String inParamclient_id, String inParamclient_secret, String inParamredirect_uri, String inParamgrant_type, STPostTokenResponseStructure& outParamResponse)
at ssReports_IS.Actions.ActionGetToken(HeContext heContext, STPostTokenRequestStructure inParamRequest, STPostTokenResponseStructure& outParamToken)
at ssDashboard_CS.RsseSpaceReports_IS.MssGetToken(HeContext heContext, IRecord inParamRequest, IRecord& outParamToken)
at ssDashboard_CS.Actions.ActionGetToken(HeContext heContext, STPostTokenRequestStructure inParamRequest, STPostTokenResponseStructure& outParamToken)
at ssDashboard_CS.Actions.ActionGetToken_CS(HeContext heContext, STPostTokenRequestStructure inParamTokenRequest, STPostTokenResponseStructure& outParamTokenResponse)
at ssDashboard_Api.RsseSpaceDashboard_CS.MssGetToken_CS(HeContext heContext, IRecord inParamTokenRequest, IRecord& outParamTokenResponse)
at ssDashboard_Api.Actions.ActionGetToken_CS(HeContext heContext, STPostTokenRequestStructure inParamTokenRequest, STPostTokenResponseStructure& outParamTokenResponse)
at ssDashboard_Api.CsRESTExpose.CsDashboard.CsDashboardControllerFlows.FlowDashboardActionGetToken(HeContext heContext, STPostTokenRequestStructure inParamRequest, STPostTokenResponseStructure& outParamResponse)
   at ssDashboard_Api.CsRESTExpose.CsDashboard.CsDashboardController.FlowDashboardActionGetToken(JSONSTPostTokenRequestStructure auxinParamRequest)


500 Internal Server Error
   at ssDashboard.CcDashboard.ActionGetToken(HeContext heContext, ICcDashboardCallbacks _callbacks, STPostTokenRequestStructure inParamRequest, STPostTokenResponseStructure& outParamResponse)


500 Internal Server Error
at ssDashboard.CcDashboard.ActionGetToken(HeContext heContext, ICcDashboardCallbacks _callbacks, STPostTokenRequestStructure inParamRequest, STPostTokenResponseStructure& outParamResponse)
at ssDashboard.Flows.FlowMainFlow.ScrnCallBack.Preparation(HeContext heContext)
at ssDashboard.Flows.FlowMainFlow.ScrnCallBack.Page_Load(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Thanks!

"500 Internal Server error" is usually an indication that the REST service you call returned another response than a 200-series one. You should increase the logging level of the REST service, and see what the actual response is.