简体   繁体   中英

How can I call the WCF service without any authentication?

When I run this in Firefox:

$.post('http://localhost:54507/Service1.svc/IService1.GetData',{
value:1
},function(){
},);

I get a "405 Method Not Allowed" error. How can I allow this call from anywhere without any authentication?

For disable authentication, you have to cahnge setting of your Web Server (IIS for examble). For your web site you have to enable Anonymous Authentication.

Try to open the URI "http://localhost:54507/Service1.svc" on your browser.

Sounds like the web server is not correctly setup for wcf there are some settings documented on MSDN that may help.

Please run firebug and have a look at what is attempting to be posted and then set a breakpoint on your svc code...

Is your webserver set to only accept https requests? Making a request using http when the resource requires https can result in a 405.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM