PDA

View Full Version : Ajax.request Works Locally, not Remotely



MaximusW
22 Aug 2011, 5:56 AM
I'm hosting my app and a web service on the same domain:
Web App: http://mydomain.com/wa/
Web Service: http://mydomain.com/ws/


The web app is calling the web service via an AJAX request using the following code:


Ext.Ajax.request({
params: {param1:param1, param2:param2},
url: 'http://mydomain.com/ws/surveyData.asmx/addSurveyInstance',
success: function(response) {console.log("Success")},
failure: function (response) {console.log("Failure")}
});

When the web app is run on the host server the web services runs without issues. When the web app is run on a remote machine it fails with the following message:
Request format is unrecognized for URL unexpectedly ending in '/addSurveyInstance'.


Stack Trace
[InvalidOperationException: Request format is unrecognized for URL unexpectedly ending in '/addSurveyInstance'.]


Any ideas as to what the issue may be would be greatly appreciated.

MaximusW
22 Aug 2011, 6:40 AM
Thanks to the following article the issue has been resolved:
"FIX Request format is unrecognized for URL unexpectedly ending in"
http://bit.ly/pfLNRd