web-services - 我的 Javascript 代码找不到 WCF 服务
问题描述
我的服务提供商已将我的代码迁移到新服务器,而我的 AJAX 代码无法再找到我的 WCF 服务。我从浏览器得到的消息是:
HTTP404: NOT FOUND – 服务器没有找到任何匹配请求的 URI(统一资源标识符)的东西。获取 - http://www.example.com/WebServices/TBox.svc/js
如果我直接浏览到本地 PC 上的 Web 服务 ( http://localhost:64805/WebServices/TBox.svc ),我会收到一条消息“这是 Windows© Communication Foundation 服务。......'。但是,如果我浏览我的托管服务,我会收到 404 Page Not Found 错误。
我从我的 web.config 中附加了一个部分,因为我怀疑它可能与此有关。
任何帮助,将不胜感激。
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="TimeboxAspNetAjaxBehavior">
<enableWebScript />
</behavior>
<behavior name="TBoxAspNetAjaxBehavior">
<enableWebScript />
</behavior>
<behavior name="WebMethodForTestingAspNetAjaxBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior>
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<services>
<service name="Timebox">
<endpoint address="http://www.example.com/WebServices/Timebox.svc" behaviorConfiguration="TimeboxAspNetAjaxBehavior" binding="webHttpBinding" contract="Timebox" />
</service>
<service name="TBox">
<endpoint address="http://www.example.com/WebServices/TBox.svc" behaviorConfiguration="TBoxAspNetAjaxBehavior" binding="webHttpBinding" contract="TBox" />
</service>
<service name="WebMethodForTesting">
<endpoint address="" behaviorConfiguration="WebMethodForTestingAspNetAjaxBehavior" binding="webHttpBinding" contract="WebMethodForTesting" />
</service>
</services>
</system.serviceModel>
问候,扫罗
解决方案
推荐阅读
- c# - 无法使用 ImageMagik 读取转换后的 pdf
- javascript - jQuery: ":checked" 总是返回 true
- php - pdf 文件在谷歌搜索结果中的页面标题
- image-processing - 什么是图像处理中的自相似测试?
- javascript - 为特定的 JS 文件挂钩 Javascript Onload
- python - 自定义张量流模型的 OOP 版本如何工作
- couchbase - N1QL 中的 REGEXP_CONTAINS 和 REGEXP_LIKE 有什么区别?
- python - Python - 计算所需的自然数个数
- tensorflow - 可视化增强的火车图像 [tensorflow object detection api]
- python - Python:为什么即使没有指示,列表值也会改变?