PDA

View Full Version : [OPEN] REST Proxy issue



Yazid
22 Sep 2016, 11:19 PM
Hi,

SA version: 4.0.1.190
channel: 4.0-stable
platform: 1.2.3.16 - darwin x64
cmd: 6.2.0.103 framework:
Ext JS 6.2.x Classic

I notice the when I did a store sync after an update, the url generated when I use a REST proxy looks like this. And the web service could not recognise the call.
http://10.34.118.250/ePackMgrSvc/api/ControlFile/MyApp.model.Control_File-102?_dc=1474614246749

Using AJAX Proxy, a store sync the url generated is correct
http://10.34.118.250/ePackMgrSvc/api/ControlFile?_dc=1474614595525

Is this a bug?

jan.turon
23 Sep 2016, 12:18 AM
Hello and thanks for report!

We unfortunately cannot reproduce this problem. Could you provide us additional info? Code of affected model could be useful.

Best regards
Jan Turon

mazhar.shaikh
16 Oct 2016, 3:13 PM
Exact same problem I am facing too. The version of SA and ExtJS is exactly as mentioned by OP. Although I havent tried using AJAX proxy yet, but definitely can confirm that using REST proxy I am facing this problem on store.sync.

To give some more background:

I have a grid with a checkbox selection model and a check column "Approved". Checking/Unchecking the column triggers a PUT request to the server with value being True or False. This was working in previous version of SA (this project has been upgraded from SA3.2 and Extjs 4.1).

However on clicking checkbox, I am now getting this:

PUT /<service>/<app>/<param1>/event/<eventId>/<Appname>.model.<ModelName>.AllocItem-29?_dc=1476659512548 HTTP/1.1

Below is code for store:

Ext.define('MyApp.store.MyAppStore.AllocItem', { extend: 'Ext.data.Store',


requires: [
'MyApp.model.BuyingPromo.AllocItem',
'Ext.data.proxy.Rest',
'Ext.data.reader.Json',
'Ext.data.writer.Json'
],


constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
storeId: 'MyApp.AllocItem',
autoLoad: false,
model: 'MyApp.model.MyAppStore.AllocItem',
proxy: {
type: 'rest',
timeout: 620000,
headers: {
Accept: 'application/json',
'Content-Type': 'application/json; charset=utf-8'
},
reader: {
type: 'json'
},
writer: {
type: 'json'
}
}
}, cfg)]);
}

});

Below is code for model. I have removed most fields and kept only 2.

Ext.define('AdvanceWebHO.model.BuyingPromo.AllocItem', {
extend: 'Ext.data.Model',


requires: [
'Ext.data.field.String',
'Ext.data.field.Number',
'Ext.data.field.Boolean'
],
fields: [
{
type: 'string',
name: 'allocId'
},
{ type: 'boolean',
name: 'isApproved'
},
]
});

jan.turon
17 Oct 2016, 6:46 AM
Thanks for the extension of report! I have opened a bug in our bug tracker.