gpt4 book ai didi

wcf - HTTP 错误 500.19 - 内部服务器错误请求的页面不能(WCF + REST + IIS7 + SSL)

转载 作者:太空宇宙 更新时间:2023-11-03 13:01:52 25 4
gpt4 key购买 nike

我正在尝试使用 SSL 在 IIS 上托管我的 WCF REST 服务。

环境:我正在带有本地 IIS 服务器的 Windows7 机器上进行测试。我已经在我的开发箱上自行注册了一个证书并且有:

  1. 为了通过 HTTPS 公开此 WCF 服务,在 IIS 中创建了一个站点。
  2. 在此站点下创建了一个应用程序并将其命名为“api”
  3. 在 IIS 中导航到我的网站
  4. 单击右侧“操作”面板中的“绑定(bind)...”。
  5. 点击“添加”
  6. 选择“https”并选择我的证书。

许多 REST 管道是通过 WCF 中的扩展使用 WcfRestContrib 库处理的。虽然从编程的角度来看这很有用,但当出现问题时,文档的方式却很少。

我目前得到的错误是:

Error Summary

HTTP Error 500.19 - Internal Server Error The requested page cannot

be accessed because the related configuration data for the page is invalid. Detailed Error Information Module IIS Web Core Notification BeginRequest Handler Not yet determined Error Code 0x8007000d Config Error Config File \?\C:\inetpub\eMobile\api\web.config Requested URL https://172.xx.xx.254:443/api Physical Path C:\inetpub\eMobile\api Logon Method Not yet determined Logon User Not yet determined

Config Source

-1:
0:

我真的不确定我在这里做错了什么。到目前为止,我已经尝试过拒绝对我的站点进行功能委托(delegate),但这没有用。有任何想法吗?我的 web.config 中有什么奇怪的地方吗?

谢谢。

<?xml version="1.0"?>
<configuration>
<connectionStrings>
<add name="e1ConnectionString" connectionString="Data Source=USSV112;Initial Catalog=e1;Integrated Security=True"
providerName="System.Data.SqlClient" />
<add name="e2ConnectionString" connectionString="Data Source=USSV112;Initial Catalog=e2;Integrated Security=True"
providerName="System.Data.SqlClient" />
<system.web>
<httpRuntime maxRequestLength="204800" executionTimeout="3600"/>
<compilation debug="true" targetFramework="4.0">
</compilation>
<httpModules>
<add name="ServiceAnonymityModule" type="WcfRestContrib.Web.ServiceAnonymityModule, WcfRestContrib, Version=1.0.6.107, Culture=neutral"/>
</httpModules>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
</system.web>
<system.webServer>
<rewrite>
<rules>
<rule name="Users" stopProcessing="true">
<match url="^rest/users/(.*)$"/>
<action type="Rewrite" url="rest/Users.svc/{R:1}" />
</rule>
</rules>
</rewrite>
<validation validateIntegratedModeConfiguration="false" />
<modules>
<remove name="ServiceAnonymityModule"/>
<add name="ServiceAnonymityModule" type="WcfRestContrib.Web.ServiceAnonymityModule, WcfRestContrib, Version=1.0.6.107, Culture=neutral"/>
</modules>
</system.webServer>
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
<listeners>
<add name="messages" type="System.Diagnostics.XmlWriterTraceListener" initializeData="d:\Temp\WcfRestContribErrors.log" />
</listeners>
</source>
<source name="System.ServiceModel.MessageLogging">
<listeners>
<add name="messages" type="System.Diagnostics.XmlWriterTraceListener" initializeData="d:\Temp\WcfRestContribMessages.log" />
</listeners>
</source>
</sources>
<trace autoflush="true"/>
</system.diagnostics>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<extensions>
<behaviorExtensions>
<add name="webAuthentication" type="WcfRestContrib.ServiceModel.Configuration.WebAuthentication.ConfigurationBehaviorElement, WcfRestContrib, Version=1.0.6.107, Culture=neutral, PublicKeyToken=89183999a8dc93b5" />
<add name="errorHandler" type="WcfRestContrib.ServiceModel.Configuration.ErrorHandler.BehaviorElement, WcfRestContrib, Version=1.0.6.107, Culture=neutral, PublicKeyToken=89183999a8dc93b5" />
<add name="webFormatter" type="WcfRestContrib.ServiceModel.Configuration.WebDispatchFormatter.ConfigurationBehaviorElement, WcfRestContrib, Version=1.0.6.107, Culture=neutral, PublicKeyToken=89183999a8dc93b5" />
<add name="webErrorHandler" type="WcfRestContrib.ServiceModel.Configuration.WebErrorHandler.ConfigurationBehaviorElement, WcfRestContrib, Version=1.0.6.107, Culture=neutral, PublicKeyToken=89183999a8dc93b5" />
</behaviorExtensions>
</extensions>
<bindings>
<customBinding>
<binding name="HttpStreamedRest">
<httpTransport maxReceivedMessageSize="209715200" manualAddressing="true"/>
</binding>
<binding name="HttpsStreamedRest">
<httpsTransport maxReceivedMessageSize="209715200" manualAddressing="true"/>
</binding>
</customBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="Rest">
<webAuthentication authenticationHandlerType="WcfRestContrib.ServiceModel.Dispatcher.WebBasicAuthenticationHandler, WcfRestContrib"
usernamePasswordValidatorType="Engage.Mobile.WebServices.Runtime.SecurityValidator, Engage.Mobile.WebServices"
requireSecureTransport="false" source="E Mobile" />
<webFormatter>
<formatters defaultMimeType="application/json">
<formatter type="WcfRestContrib.ServiceModel.Dispatcher.Formatters.PoxDataContract, WcfRestContrib"
mimeTypes="application/xml,text/xml" />
<formatter type="WcfRestContrib.ServiceModel.Dispatcher.Formatters.DataContractJson, WcfRestContrib"
mimeTypes="application/json" />
<formatter type="WcfRestContrib.ServiceModel.Dispatcher.Formatters.FormUrlEncoded, WcfRestContrib"
mimeTypes="application/x-www-form-urlencoded" />
</formatters>
</webFormatter>
<errorHandler errorHandlerType="WcfRestContrib.ServiceModel.Web.WebErrorHandler, WcfRestContrib" />
<webErrorHandler logHandlerType="Engage.Mobile.WebServices.Runtime.LogHandler, Engage.Mobile.WebServices" returnRawException="true" exceptionDataContractType="" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>

最佳答案

看起来很像这个thread

建议的答案是

  1. Right click the folder where your site is located: "C:\Users\NAME\SiteName" and selecting Properties
  2. Select the Security tab and click on Edit
  3. Add.. and type in "IIS_IUSRS"

关于wcf - HTTP 错误 500.19 - 内部服务器错误请求的页面不能(WCF + REST + IIS7 + SSL),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4794918/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com