【发布时间】:2011-03-05 05:07:36
【问题描述】:
我们将 AJAX 级联下拉菜单和自动完成功能与提供数据的 Restful WebService 服务一起使用。使用一个端点(非安全)一切工作正常,直到我们使用 https 尝试相同的网页。我们的 Webappplication 需要同时支持这两者。在关于这个问题的极少数文章/博客中,我发现 2 篇适用于我的要求。
- http://blog.abstractlabs.net/2009/02/ajax-wcf-services-and-httphttps.html
- http://www.mydotnetworld.com/post/2008/10/18/Use-a-WCF-Service-with-HTTP-and-HTTPS-in-C.aspx
我遵循相同的模式,添加了 2 个端点,假设 WCF 将拾取适当的端点来查看 HTTP 或 HTTPS 协议。在我的开发机器 (XP-IIS5) 和 1 Server 2003R2(IIS6) 中工作就像一个魅力,但在生产服务器 2003-IIS6 中工作。 IIS 中的网站完全相同(包括权限等)。 它抛出的错误 - 错误 500(找不到与绑定 WebHttpBinding 的端点的方案 https 匹配的基地址。注册的基地址方案是 [http]..)
这是示例配置(忽略错别字)
<system.serviceModel>
<bindings>
<webHttpBinding>
<binding name="SecureBinding">
<security mode="Transport"/>
</binding>
</webHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="SearchServiceAspNetAjaxBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<services>
<service name="SearchService">
<endpoint address="" behaviorConfiguration="SearchServiceAspNetAjaxBehavior"
binding="webHttpBinding" contract="SearchServiceContract" />
<endpoint address="" behaviorConfiguration="SearchServiceAspNetAjaxBehavior"
binding="webHttpBinding" bindingConfiguration="SecureBinding" contract="SearchServiceContract" />
</service>
</services>
</system.serviceModel>
非常感谢您对此的任何帮助?
谢谢 KSS
【问题讨论】:
-
您找到解决方案了吗?
标签: wcf http rest https webhttpbinding