on 09-11-2015 2:45 PM
I am hosting a UI5 application on HCP.
UI5 Version 1.30.8 has been recently released, and HCP automatically runs the latest version of UI5.
I have an OData model in my application, on which I performed a "create" (or HTTP POST) on version 1.28.9 successfully.
Since the UI5 upgrade this POST has stopped working.
I get the following error:
First the "refresh security token" request, which gets a 200 and the CSRF token, followed by the POST. Which isn't even attempted.
The Request:
In the error handler I got this text: "The following problem occurred: Failed to execute 'send' on 'XMLHttpRequest".
Any ideas why this is happening?
My code is here:
var mODataModel = new sap.ui.model.odata.ODataModel("/ticketupdater");
mODataModel.setDefaultBindingMode(sap.ui.model.BindingMode.TwoWay);
oComponent.setModel(mODataModel, "ticket");
mODataModel.refreshSecurityToken();
mODataModel.create("/SEOD_TicketUpdater_BORootCollection",
oUpdate Obj, //JSON object for creation
{
async : false,
success : function(oData){
//handle success (code removed)
}, error : function(err){
//handle error (code removed)
}
}
);
When I do this POST in a rest client or from an older version UI5 application, the request works perfectly. So it is an issue with doing the POST from this version of UI5, I believe. I cannot see any difference in the OData model control in the SAPUI5 sdk though, for create...
I've had a thought: perhaps the issue isn't with 1.30, but with a change on HCP: I am running the application on HCP (which points to version 1.30) and it doesn't work, but when I run it locally it does. However it USED to work on HCP...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't think you'd need to manually refresh the security token using refreshSecurityToken() ! The oData model create would take care of that. Try without using refreshSecurityToken().
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, I'll try this.
But the reason for refreshing the token was that between the creation of my OData model, and the first POST there could be a large time-lapse, and I was experiencing expired token issues in version 1.28.
But I will try this and get back to you, thanks for the suggestion.
Unfortunately this did not resolve my issue
There is no attempt to POST to the OData service still: the "send" fails, the request never leaves the OData model from what I can tell..
I get the message: "The following problem occurred: Failed to execute 'send' on 'XMLHttpRequest': Failed to load"
try to call like this
refreshSecurityToken($.noop, $.noop, false)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
anything in console? stack trace? where exactl that exception happens
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
11 | |
10 | |
8 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.