【发布时间】:2011-09-12 23:29:43
【问题描述】:
我在使用 SSL 和 WCF 使 Web 服务正常工作时遇到问题。
如果我在 IIS 中签入“需要 SSL”,则会收到此错误:
WebHost 未能处理请求。
发件人信息: System.ServiceModel.ServiceHostingEnvironment+HostingManager/36097441 异常:System.ServiceModel.ServiceActivationException:服务 '/' 由于编译过程中的异常而无法激活。这 异常消息是:服务 'ISS.MS.WebServices.MessageDispatch.MessageDispatchWebService' 有 零应用程序(非基础设施)端点。这可能是因为 没有为您的应用程序找到配置文件,或者因为没有 与服务名称匹配的服务元素可以在 配置文件,或者因为没有定义端点 服务元素.. ---> System.InvalidOperationException:服务 'ISS.MS.WebServices.MessageDispatch.MessageDispatchWebService' 有 零应用程序(非基础设施)端点。这可能是因为 没有为您的应用程序找到配置文件,或者因为没有 与服务名称匹配的服务元素可以在 配置文件,或者因为没有定义端点 服务元素。
但是,如果我取消选中它,页面会在浏览器中正常加载,但随后出现此错误 当我尝试调用它时。
服务'ISS.MS.WebServices.MessageDispatch.MessageDispatchWebService' 具有零应用程序(非基础设施)端点。这可能是 因为没有为您的应用程序找到配置文件,或者 因为找不到与服务名称匹配的服务元素 配置文件,或者因为没有定义端点 服务元素。
这是配置:
<system.serviceModel>
<services>
<service name="ISS.MS.WebServices.MessageDispatchWcfService">
<endpoint
address=""
binding="basicHttpBinding" bindingConfiguration="basicHttpBinding_MS2"
contract="ISS.MS.WebServices.IMessageDispatchWcfService" />
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceDebug includeExceptionDetailInFaults="False" />
<serviceMetadata httpsGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="basicHttpBinding_MS2" >
<readerQuotas maxStringContentLength="1048576" />
<security mode="Transport">
</security>
</binding>
</basicHttpBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true">
</serviceHostingEnvironment>
</system.serviceModel>
我可以使用普通的 HTTP 让它完美地工作,但 HTTPS 不起作用。
我猜是 IIS 设置问题还是 WCF 配置问题?
【问题讨论】:
标签: wcf