PDA

View Full Version : Limitation of Ext.util.JSONP and Problem of Ext.Ajax.Request



Sameer Khan
17 Jan 2012, 11:21 PM
Hi All, I am in a big problem...I need help from somebody.

Here in sencha touch which one i can use to make post request to my server to send xml string format data...
Bcz JSONP supporting GET method....But Ext.Ajax.request won't support for cross domain communication....

Let me know the solution asap....


Thanks in advance...

mitchellsimoens
18 Jan 2012, 5:21 AM
You can use JsonP and return json with nested XML:


mycallback({ "xml" : "<...>..." });

Sameer Khan
18 Jan 2012, 8:33 PM
You can use JsonP and return json with nested XML:


mycallback({ "xml" : "<...>..." });


Hi, Thanks for your answer first...But here i am sending a long lenght xml string format data to .net server...
But on .net side on query string parameter some limitation is there[Bad Request 404 Error]...How can i achieve this problem.

IN web.config file Query string max length is ~2071351...How to modify this.

wirraway
18 Jan 2012, 9:13 PM
Hey Mitchell,

That's an awesome tip. I've used JSONP to do this with JSON data like this:

Ext.util.JSONP.request({
url: 'http://sourceofdata.com/whatever',
callbackKey: 'callback',
callback: function(data) {
for(var i=0;i<data.length;i++){
Ext.StoreMgr.get('SomeStore').add(data[i]);
}
So instead of using a proxy with a reader, this populates the datastore externally.

The question is, how do you do this with XML data padded as you said? Where do I set the equivalent of this:
proxy: {
type: 'ajax',
url: 'http://somewhere.com/data.xml',
reader: {
type: 'xml',
record: 'book'
}
root: 'bookList',

How does the Ext.StoreMgr.get('SomeStore').add(data[i]); code know how to parse the xml, the way that a proxy/reader would?