Topic
1 reply Latest Post - ‏2011-04-18T08:45:26Z by SystemAdmin
SystemAdmin
SystemAdmin
9224 Posts
ACCEPTED ANSWER

Pinned topic AJAX call to REST service not working with Firefox

‏2011-04-07T23:48:57Z |
NOTE: this thread was migrated from projectzero.org. Some content and formatting may have been lost in the move.


Originally posted by projectzero userid: ahamed - f=4&t=2299#p9347
I am implementing a REST service to be called from java script code, calling dojo.xhrGet which is hitting the REST service OnList(), it works with IE and does not with firefox and chorme and shows this error:

zero.core.handlers.DefaultRequestHandler::onRequest Thread-2
SEVERE CWPZC1003W: Request processing terminated for URI: /mail/resources/SendEmailService?service=IBM%20GetStarted%20with%20Business%20Process%20Management%2C&salutation=&lastname=&firstname=&country=&company=&city=&indestry=&state_province=&phone=&email=&interestedin=&sendmeemail=false&othercommunication=false; file not found: No handlers for OPTIONS

Here is a sample code:
var xhrArgs = {
url : "http://localhost:8085/mail/resources/SendEmailService",
content : emailContent,
handle : function(response, ioargs) {
....
var deferred = dojo.xhrGet(xhrArgs);

Any idea for how to fix this?
Updated on 2011-04-18T08:45:26Z at 2011-04-18T08:45:26Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    9224 Posts
    ACCEPTED ANSWER

    Re: AJAX call to REST service not working with Firefox

    ‏2011-04-18T08:45:26Z  in response to SystemAdmin

    Originally posted by projectzero userid: KentaTakahashi - f=4&t=2299#p9351
    It seems a same-origin policy blocks your XHR.
    Same origin policy - Wikipedia, the free encyclopedia : http://en.wikipedia.org/wiki/Same_origin_policy

    Browser cannot send XHR to other host, protocol and port.
    To avoid this, we have to use XHR in same origin or something server-side technology like reverse proxy.