gpt4 book ai didi

IIS7 错误中的 WCF AuthenticationService

转载 作者:行者123 更新时间:2023-12-02 05:14:36 47 4
gpt4 key购买 nike

我有一个使用默认应用程序池在 IIS 7 上运行的 WCF 服务器,启用了 SSL,服务安装在 SBS Server 2008 中。我使用 wcf 和 SQL 2005 实现客户端应用程序服务,以便在我的应用程序中设置访问控制。该应用程序运行在 windows vista 下,使用 WPF 制作。在我的开发机器上,应用程序和 WCF 服务运行良好,我用于试验的 IIS 是本地 IIS 7,数据库是我服务器中托管的 SQL Server 2005 数据库。我正在使用 Visual Studio 项目设计器来启用和配置客户端应用程序服务。使用 https://localhost/WcfServidorFundacion。当我将身份验证服务位置更改为 https://WcfServices:5659/WcfServidorFundacion 并重新编译应用程序时,出现以下错误。 信息:Web 服务返回错误状态代码:InternalServerError。服务失败详情:{"Message":"Error while processing your request","StackTrace":"","ExceptionType":""}

堆栈跟踪: zh System.Net.HttpWebRequest.GetResponse() zh System.Web.ClientServices.Providers.ProxyHelper.CreateWebRequestAndGetResponse(String serverUri, CookieContainer& cookies, String username, String connectionString, String connectionStringProvider, String[] paramNames, Object[] paramValues, 类型 returnType)

内部异常:System.Net.WebException Message="远程服务器错误:(500) 内部服务器错误。"

我可以使用上面提到的 url 从导航器访问 WCF 服务,甚至可以在我的项目中创建一个 webReference。我捕获了响应,但我无法发布它,因为我没有 10 个信誉点

我激活了 IIS 7 服务器中的错误日志,结果是 ManagedPipilineHandler 中的警告。如果有人能帮助我,我将不胜感激

错误和警告No.↓ 严重性事件模块名称
132. 查看跟踪警告 -MODULE_SET_RESPONSE_ERROR_STATUS模块名称 ManagedPipelineHandler通知128HTTPStatus 500HttpReason 内部服务器错误HttpSubStatus 0错误代码 0配置异常信息
通知 EXECUTE_REQUEST_HANDLERErrorCode La operación se ha completado correctamente. (0x0)

也许这可以帮助,是我服务的 web.config

<?xml version="1.0" encoding="utf-8"?>
<!--
Nota: como alternativa para editar manualmente este archivo, puede utilizar la
herramienta Administración de sitios web para configurar los valores de la aplicación. Utilice
la opción Sitio Web->Configuración de Asp.Net en Visual Studio.
Encontrará una lista completa de valores de configuración y comentarios en
machine.config.comments, que se encuentra generalmente en
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>


<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>


<appSettings />
<connectionStrings>
<remove name="LocalMySqlServer" />
<remove name="LocalSqlServer" />
<add name="fundacionSelfAut" connectionString="Data Source=FUNDACIONSERVER/PRUEBAS;Initial Catalog=fundacion;User ID=wcfBaseDatos;Password=qwerty_2009;" providerName="System.Data.SqlClient" />
</connectionStrings>



<system.web>

<profile enabled="true" defaultProvider="SqlProfileProvider">
<providers>
<clear />
<add name="SqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="fundacionSelfAut" applicationName="fundafe" />
</providers>
<properties>
<add name="FirstName" type="String" />
<add name="LastName" type="String" />
<add name="PhoneNumber" type="String" />
</properties>
</profile>

<roleManager enabled="true" defaultProvider="SqlRoleProvider">
<providers>
<clear />
<add name="SqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="fundacionSelfAut" applicationName="fundafe" />
</providers>
</roleManager>

<membership defaultProvider="SqlMembershipProvider">
<providers>
<clear />
<add name="SqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="fundacionSelfAut" applicationName="fundafe" enablePasswordRetrieval="false" enablePasswordReset="false" requiresQuestionAndAnswer="true" requiresUniqueEmail="true" passwordFormat="Hashed" />
</providers>
</membership>

<authentication mode="Forms" />
<compilation debug="true" strict="false" explicit="true">
<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
<!--
La sección <authentication> permite la configuración
del modo de autenticación de seguridad utilizado por
ASP.NET para identificar a un usuario entrante.
-->
<!--
La sección <customErrors> permite configurar las
acciones que se deben llevar a cabo/cuando un error no controlado tiene lugar
durante la ejecución de una solicitud. Específicamente,
permite a los desarrolladores configurar páginas de error html
que se mostrarán en lugar de un seguimiento de pila de errores.

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->


<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</controls>
</pages>

<httpHandlers>
<remove verb="*" path="*.asmx" />
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</httpModules>
<sessionState timeout="40" />


</system.web>

<system.codedom>

<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5" />
<providerOption name="WarnAsError" value="false" />
</compiler>
</compilers>

</system.codedom>


<!--
La sección webServer del sistema es necesaria para ejecutar ASP.NET AJAX en Internet
Information Services 7.0. Sin embargo, no es necesaria para la versión anterior de IIS.
-->
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules>
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated" />
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</handlers>
<tracing>
<traceFailedRequests>
<add path="*">
<traceAreas>
<add provider="ASP" verbosity="Verbose" />
<add provider="ASPNET" areas="Infrastructure,Module,Page,AppServices" verbosity="Verbose" />
<add provider="ISAPI Extension" verbosity="Verbose" />
<add provider="WWW Server" areas="Authentication,Security,Filter,StaticFile,CGI,Compression,Cache,RequestNotifications,Module" verbosity="Verbose" />
</traceAreas>
<failureDefinitions statusCodes="401.3,500,403,404,405" />
</add>
</traceFailedRequests>
</tracing>
<security>
<authorization>
<add accessType="Allow" users="germanbarbosa,informatica" />
</authorization>
<authentication>
<windowsAuthentication enabled="false" />
</authentication>
</security>
</system.webServer>

<system.web.extensions>
<scripting>
<webServices>
<authenticationService enabled="true" requireSSL="true" />
<profileService enabled="true" readAccessProperties="FirstName,LastName,PhoneNumber" />
<roleService enabled="true" />
</webServices>
</scripting>
</system.web.extensions>


<system.serviceModel>
<services>
<!-- this enables the WCF AuthenticationService endpoint -->
<service behaviorConfiguration="AppServiceBehaviors" name="System.Web.ApplicationServices.AuthenticationService">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="userHttps" bindingNamespace="http://asp.net/ApplicationServices/v200" contract="System.Web.ApplicationServices.AuthenticationService" />
</service>
<!-- this enables the WCF RoleService endpoint -->
<service behaviorConfiguration="AppServiceBehaviors" name="System.Web.ApplicationServices.RoleService">
<endpoint binding="basicHttpBinding" bindingConfiguration="userHttps" bindingNamespace="http://asp.net/ApplicationServices/v200" contract="System.Web.ApplicationServices.RoleService" />
</service>
<!-- this enables the WCF ProfileService endpoint -->
<service behaviorConfiguration="AppServiceBehaviors" name="System.Web.ApplicationServices.ProfileService">
<endpoint binding="basicHttpBinding" bindingNamespace="http://asp.net/ApplicationServices/v200" bindingConfiguration="userHttps" contract="System.Web.ApplicationServices.ProfileService" />
</service>

</services>

<bindings>
<basicHttpBinding>
<!-- Set up a binding that uses Username as the client credential type -->
<binding name="userHttps">
<security mode="Transport">
</security>
</binding>
</basicHttpBinding>
</bindings>

<behaviors>
<serviceBehaviors>
<behavior name="AppServiceBehaviors">
<serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceAuthorization principalPermissionMode="UseAspNetRoles" roleProviderName="SqlRoleProvider" />
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="MembershipProvider" membershipProviderName="SqlMembershipProvider" />
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
</system.serviceModel>

</configuration>

最佳答案

当使用 WCF 时,尝试获得尽可能多的可见性总是好的。我经常使用两种工具。它们是 WCF 跟踪查看器和 WCF 配置编辑器

  • SvcConfigEditor.exe
  • SvcTraceViewer.exe

取决于您使用的是 x64 还是 x84 机器以及 .Net 的版本,它们应该位于其中之一。

  • C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\
  • C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\
  • C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Bin
  • C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin查看

查看 http://merbla.blogspot.com/2009/02/wcf-tools.html

关于IIS7 错误中的 WCF AuthenticationService,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1859552/

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