REST WCF Win2003上的Windows服务托管(https)
我在Windows服务中托管了REST WCF服务。该服务公开了一个返回布尔值的方法,我可以让REST web服务在WinXp上运行。我还使用makecert生成了一个开发证书,并将其分配给该服务侦听的端口(1443)。 Https在WinXp上也能很好地工作。但是,当我在Win2003中使用相同的内容并在IE中键入URL时,它会显示“无法显示页面”。在托管服务时没有错误,服务在端口上侦听(ServiceHost.Open没有任何错误和成功)。是否有必须在Win2003中完成此设置? Win2003是生产环境,https必须在这方面开展工作。REST WCF Win2003上的Windows服务托管(https)
这里是我使用的配置文件,
<system.serviceModel>
<bindings>
<webHttpBinding>
<binding name="httpBinding">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</webHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="spectrumServiceBehavior" name="MyApp.TestService">
<host>
<baseAddresses>
<add baseAddress="https://localhost:1443/" />
</baseAddresses>
</host>
<endpoint address=""
binding="webHttpBinding"
bindingConfiguration ="httpBinding"
contract="MyApp.ITestService" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="spectrumServiceBehavior">
<!-- To receive exception details in faults for debugging purposes,
set the value below to true. Set to false before deployment
to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceMetadata httpsGetEnabled ="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
任何想法?
我遇到过同样的问题。 WinXP开发环境使用HTTPS,本地创建并通过httpcfg分配给自定义端口的证书。 在Windows 2003上使用导入的证书和相同的httpcfg配置在生成环境中尝试获取服务的WSDL时提供“中断连接”。
望着Windows登录我终于找到了这个错误:
Event Source: Schannel
A fatal error occurred when attempting to access the SSL server credential private key. The error code returned from the cryptographic module is 0x80090016.
我的问题是,我导入的证书在用户帐户存储,然后在本地存储复制。通过这种方式,私钥被留下... http://support.microsoft.com/kb/939616(甚至没有警告!!!) 尽管如此,在新位置打开证书,显示了私钥的存在!
我期望在Windows 2003上,您必须允许应用程序侦听端口(除非它以管理员身份运行),并且必须将SSL证书分配给端口 - 两者均由httpcfg.exe执行。还要检查是否没有防火墙阻塞端口上的通信。
我在WinXp和Win2003中都使用了httpcfg.exe。 SSL证书已分配给端口,应用程序正在监听端口,并使用管理员帐户运行。我在同一台Win2003机器上尝试了URL,但IE仍然报错,说网页无法显示。 – 2011-06-24 14:40:29
我也检查过防火墙,它没有在那台机器上运行。 ICS服务没有运行,因此也是防火墙。 – Rohith
我有完全相同的问题,我已经使所有在WindowsXP上工作,但在Windows 2003 R2中没有做任何事情。环顾微软文档/论坛/问答,它总是相同的东西......写在这里希望听到你解决你的问题。 Tnx提前。 –