netnutmike
15 Jan 2011, 8:17 AM
Hello,
I am trying to to implement an Ajax.Request and it is to a different server than the app is hosted on. After creating this I remember the cross-site-scripting limitations. In firebug I never see the request go out and the error is "communication failure".
But, here is the odd thing, when I first created the request I put the headers in incorrectly and was actually getting an unsupported media type error from the remote server. I was also seeing the request in firebug. When I correct the headers I get nothing but the aforementioned error. I get the same result if I comment out the headers completely.
So my question is. Can you with Ajax.Request retrieve data from another server? My code is below and you can see the commented out headers that do not work but are allowing me to talk to the other server.
Ext.Ajax.request({
url: 'http://mca/JSONService.asmx',
method: 'post',
//headers: 'http://mca/scanByHostname',
headers: {
'SOAPAction': 'http://mca/scanByHostname'
},
xmlData: xmldata,
success: function(response, opts) {
console.log(response);
},
failure: function(response, opts) {
console.log(response);
}
});
I am trying to to implement an Ajax.Request and it is to a different server than the app is hosted on. After creating this I remember the cross-site-scripting limitations. In firebug I never see the request go out and the error is "communication failure".
But, here is the odd thing, when I first created the request I put the headers in incorrectly and was actually getting an unsupported media type error from the remote server. I was also seeing the request in firebug. When I correct the headers I get nothing but the aforementioned error. I get the same result if I comment out the headers completely.
So my question is. Can you with Ajax.Request retrieve data from another server? My code is below and you can see the commented out headers that do not work but are allowing me to talk to the other server.
Ext.Ajax.request({
url: 'http://mca/JSONService.asmx',
method: 'post',
//headers: 'http://mca/scanByHostname',
headers: {
'SOAPAction': 'http://mca/scanByHostname'
},
xmlData: xmldata,
success: function(response, opts) {
console.log(response);
},
failure: function(response, opts) {
console.log(response);
}
});