简体   繁体   English

“由于内部错误,服务器无法处理请求”。 WCF 服务,在 IIS 上部署时

[英]'The server was unable to process the request due to an internal error'. WCF Service, when deployed on IIS

I'm trying to consume a service, that I created, the service consumes perfectly when its deployed on the localhost.我正在尝试使用我创建的服务,该服务在部署在本地主机上时可以完美使用。 But when I try to consume the same service after deploying it on the server(IIS).但是当我在服务器(IIS)上部署它后尝试使用相同的服务时。 I get the following error我收到以下错误

The server was unable to process the request due to an internal error.For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.由于内部错误,服务器无法处理请求。有关错误的详细信息,请在服务器上打开 IncludeExceptionDetailInFaults(从 ServiceBehaviorAttribute 或从配置行为),以便将异常信息发送回客户端,或根据 Microsoft .NET Framework 3.0 SDK 文档打开跟踪并检查服务器跟踪日志。

Details about my service: I call upon a 3rd party service : http://www.webservicex.net/sunsetriseservice.asmx?op=GetSunSetRiseTime to create my service.关于我的服务的详细信息:我调用了 3rd 方服务: http : //www.webservicex.net/sunsetriseservice.asmx?op=GetSunSetRiseTime来创建我的服务。

EDIT: Full Stack Trace:编辑:全栈跟踪:

Stack Trace: 


[FaultException: The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.]
   System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +10614671
   System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +336
   ServiceReference1.IService.sunsetSunRiseTime(String strlatitude, String strlongitude) +0
   _Default.btSubmit_click(Object sender, EventArgs e) +85
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9553178
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +103
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724

EDIT 2: Service Description : http://www.webservicex.net/WS/WSDetails.aspx?WSID=65&CATID=12 Is this because I'm using an asmx service instead of .svc .编辑 2:服务描述: http : //www.webservicex.net/WS/WSDetails.aspx? WSID=65&CATID =12这是因为我使用的是asmx服务而不是.svc Sorry if I sound confused!对不起,如果我听起来很困惑!
EDIT 3 Server side web.config : https://gist.github.com/KodeSeeker/5226269编辑 3服务器端 web.config: https : //gist.github.com/KodeSeeker/5226269

EDIT 4: ** With IncludeExceptionDetailInFaults set true( PS Im working on a remote server that keeps disconnecting so Im not sure if this error is also because of that ):编辑 4: ** 将 IncludeExceptionDetailInFaults 设置为 true(PS 我在一个不断断开连接的远程服务器上工作,所以我不确定这个错误是否也是因为这个):

Stack Trace: 


[FaultException`1: The HTTP request was forbidden with client authentication scheme 'Anonymous'.]
   System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +10614671
   System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +336
   ServiceReference1.IService.sunsetSunRiseTime(String strlatitude, String strlongitude) +0
   _Default.btSubmit_click(Object sender, EventArgs e) +85
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9553178
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +103
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724

I would start by looking at this message:我将首先查看此消息:

The HTTP request was forbidden with client authentication scheme 'Anonymous'客户端身份验证方案“匿名”禁止 HTTP 请求

Do you have Anonymous authentication enabled in IIS?您是否在 IIS 中启用了匿名身份验证? You can check that in IIS Manager.您可以在 IIS 管理器中检查。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM