WCF 服务支持文件 jsdebug 无法加载
我有一个从客户端 JavaScript 调用的 WCF 服务。 调用失败并出现 Service is null JavaScript 错误。 WebDevelopment 帮助程序跟踪显示加载 jsdebug 支持文件的调用会导致 404(文件未找到)错误。
重新启动 IIS 或清除临时 ASP.Net 文件或在 web.config 中的编译标记上设置 batch="false" 无法解决问题
从浏览器
.svc" rel="nofollow noreferrer">https://Myserver/MyApp/Services/MyService.svc
https://Myserver/MyApp/Services/MyService.svc/jsdebug 结果为 404。
问题似乎与 https 协议有关。 使用 http /jsdebug 下载支持的 JS 文件。
有任何想法吗?
TIA
I have a WCF service that gets called from client side JavaScript. The call fails with a Service is null JavaScript error. WebDevelopment helper trace shows that the calls to load the jsdebug support file results in a 404 (file not found) error.
Restarting IIS or clearing out the Temp ASP.Net files or setting batch="false" on the compilation tag in web.config does not resolve the problem
From the browser
https://Myserver/MyApp/Services/MyService.svc displays the service metadata
however
https://Myserver/MyApp/Services/MyService.svc/jsdebug results in a 404.
The issue seems to be with the https protocol. With http /jsdebug downloads the supporting JS file.
Any ideas?
TIA
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果在完成所有可能的工作后您仍然遇到相同的错误。 只需添加“AJAX Enabled WCF-Service”即可。
If you still get the same error after all your possible work done. Just add a "AJAX Enabled WCF-Service".
对我来说,问题如下: 我们将 MVC 添加到带有路由的解决方案中。 我们的 WCF 服务并没有被忽视。 我通过添加以下规则解决了这个问题(其中“WCF”是我们保存服务的文件夹)。
希望这可以节省某人几个小时。
For me the issue was the following; we added MVC to a solution with routing. Our WCF services were not being ignored. I resolved this by adding the following rule (where "WCF" is the folder we keep our services in).
Hope that saves somebody a few hours.
弄清楚了!
这是 web.config 中的服务配置部分
查看端点上的 bindingConfiguration 属性。 值“webBinding”指向绑定中的绑定名称=“webBinding”标记,这就是告诉服务使用 HTTPS 传输级别安全性的内容。 在我的例子中,属性值为空,导致通过 HTTPS 对 /js 或 /jsdebug 文件的 Web 服务请求失败并抛出 404 错误。
请注意,如果通过 http 而不是 https 访问服务(在没有证书的本地计算机上进行测试时),则绑定配置属性应该为空(“”)
希望这对某人有帮助。
Figured it out!
Here is the services configuration section from web.config
Look at the bindingConfiguration attribute on the endpoint. The value "webBinding" points to the binding name="webBinding" tag in the bindings and that is what tells the service to use Transport level security it HTTPS. In my case the attribute value was empty causing the webservice request to the /js or /jsdebug file over HTTPS to fail and throw a 404 error.
Note that the bindingConfiguration attribute should be empty ("") if the service is accessed via http instead of https (when testing on local machine with no certs)
Hope this helps someone.