404 not found when accessing WCF JSON service using jQuery

I have a WCF service hosted in IIS that seems to be working fine, but I cannot access it through jQuery on the client side.

My site structure is as follows:

localhost:9080/Website 
localhost:9080/WCFService

I set the anonymous authentication user id to the AppPool id id.

When I try to access the GET method from the browser, it returns JSON data just fine. But when I try to get the same method from the client using jQuery $ .ajax (), the server returns a 404 error.

WCF Method URL

localhost:9080/WCFService/Service.svc/SimpleMethod

Method signature

string SimpleMethod()

I have already tried searching for articles on the Internet, and I don’t think it is web.configany different. For me it seems like a right.

Can anyone shed some light on this issue?

-Thank!

+3
2

-

, <webHttp /> <enableWebScript />. .

+2

GET , JSON

http://localhost:9080

jQuery $.ajax() 404 .

  • URL- ajax? URL.

, .

( ), , , ajax , URL

ajax.

0

Source: https://habr.com/ru/post/1785137/


All Articles