Click here to Skip to main content
15,887,374 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a web service with the url:
http://www.m-hakehilot.co.il/kehila_search/kehilot/retrieve.json[^]

When I tested it in the SoapUI foftware, it seem to work well.
In the SoapUI I configured the service type to REST, and the method to POST.

After it, I tried to use it in ajax code, but I got the 404 (not found) error.
My ajax code:
JavaScript
$.ajax({
  url: "http://www.m-hakehilot.co.il/kehila_search/kehilot/retrieve.json",
  type: 'post',
  dataType: 'json',
  error: function (XMLHttpRequest, textStatus, errorThrown) {
     console.log('get kehilot - error details:');
     console.log('XMLHttpRequest: ' + JSON.stringify(XMLHttpRequest));
     console.log('textStatus: ' + JSON.stringify(textStatus));
     console.log('errorThrown: ' + JSON.stringify(errorThrown));

     return [];
  },
  success: function (data) {
 //DO SOMETHING

  }
});


Any help?

Thanks in advance!

What I have tried:

I tried a lot of options:
Send data, change the url, but no succeeded.
Posted
Updated 25-Dec-16 23:26pm
Comments
Homero Rivera 21-Jul-16 0:47am    
404 error means not found. A single wrong character in the domain can trigger that... are you 100% it's right? Are you 100% sure the server is available from your current network?

1 solution

The problem was wrong CORS settings in the server.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900