PDA

View Full Version : Can't change Http 'Method' - GET / POST



sridhar.boganathan
2 Mar 2012, 3:20 AM
Hi All,

I am using Grid panel and store to display the data. The data will be loaded from web service which is from other server. Using JsonP proxy configs from store, I am calling web service. My web service accepts only "POST" Http request.

I can't change http method. I am using the following code to call the web service.



Ext.application({
name: 'ExtJSPoC',
launch: function() {
Ext.create('Ext.data.Store', {
storeId:'simpsonsStore',
fields:['jsxid', 'jsxtext', 'type'],
proxy: {
type: 'jsonp',
url: 'https://mywebserviceurl/RetrieveUserDetails',
method: 'POST',
reader: {
type: 'xml',
root: 'data',
record: 'record'
}
},
autoLoad: true
});
var panel = Ext.create('Ext.grid.Panel', {
title: 'Browser',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [
{ header: 'Name', dataIndex: 'jsxid' },
{ header: 'Email', dataIndex: 'jsxtext', flex: 1},
{ header: 'Phone', dataIndex: 'type' }
],
height: '100%',
width: '100%'
});
Ext.create('Ext.container.Viewport', {
height: '100%',
width: '100%',
items: [panel]
});
}
});


Could you please let me know how can we change the http method from Proxy and Store and let me know if I am in a wrong way to call a web service.

Thanks in Advance
Sridhar

vietits
2 Mar 2012, 4:18 AM
JSONP proxy works by injects a SCRIPT tag into DOM so it only supports GET method.