简体   繁体   中英

deploying precompiled WCF REST service error “service not defined”

I created an ASP.NET REST service (using WCF) and access it through one of my .aspx page. the problem is that when I publish (precomile) my code to the web server, I get an error :

"ThunServ not defined" in the Javascript console of my browser.

don't know what's causing it and how to solve it.

It means that the WCF service isn't initializing correctly, and so the client-side object that represents it isn't being created in Javascript.

Make sure your web.config contains the proper bindings and endpoints for the service. Then try testing its ASMX file on the server to see if you can get the client-side script to generate, eg http://myserver/myapp/myservice.asmx/js . If it doesn't generate, you should get an error (you'll need to turn on debugging in the web.config to read it) telling you what went wrong.

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