【发布时间】:2011-02-27 00:30:55
【问题描述】:
我有一个 WCF 服务,由于这个错误,我已经归结为几乎没有。它把我逼到了墙角。这就是我现在所拥有的。
一个非常简单的 WCF 服务,其中一个方法返回一个值为“test”的字符串。
一个非常简单的 Web 应用程序,它使用服务并将字符串的值放入标签中。
在 Win 2003 上运行带有 SSL 证书的 IIS 6 的 Web 服务器。
在同一台服务器上工作的其他 WCF 服务。
我将 WCF 服务发布到它的 https 位置
我在 VS 中以调试模式运行 Web 应用程序,它运行良好。
我将 Web 应用程序发布到 WCF 服务驻留在同一 SSL 证书下的同一台服务器上的 https 位置
我得到,“远程服务器返回错误:(403) Forbidden”
我几乎更改了 IIS 以及 WCF 和 Web 应用程序中的所有设置,但无济于事。我比较了 WCF 服务中的设置,一切都一样。
以下是 WCF 服务和 WEB 应用程序的 web.config 中的设置:
看来问题与 Web 应用程序有关,但我没有想法。任何想法:
WCF 服务:
<system.serviceModel>
<bindings>
<client />
<services>
<service behaviorConfiguration="Ucf.Smtp.Wcf.SmtpServiceBehavior" name="Ucf.Smtp.Wcf.SmtpService">
<host>
<baseAddresses>
<add baseAddress="https://test.net.ucf.edu/webservices/Smtp/" />
</baseAddresses>
</host>
<endpoint address="" binding="wsHttpBinding" contract="Ucf.Smtp.Wcf.ISmtpService" bindingConfiguration="SSLBinding">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="Ucf.Smtp.Wcf.SmtpServiceBehavior">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" httpsHelpPageEnabled="True"/>
</behavior>
</serviceBehaviors>
</behaviors>
网络应用:
<system.serviceModel>
<bindings><wsHttpBinding>
<binding name="WSHttpBinding_ISmtpService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text"
textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
establishSecurityContext="true" />
</security>
</binding>
<client>
<endpoint address="https://net228.net.ucf.edu/webservices/smtp/SmtpService.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ISmtpService"
contract="SmtpService.ISmtpService" name="WSHttpBinding_ISmtpService">
<identity>
<dns value="localhost" />
</identity>
</client>
</system.serviceModel>
【问题讨论】: