我正在尝试使用我创建的服务,当服务部署在localhost上时,服务会完全消耗。但是当我在服务器(IIS)上部署它之后尝试使用相同的服务时。我收到以下错误
由于内部错误,服务器无法处理请求。有关错误的更多信息,请在服务器上启用IncludeExceptionDetailInFaults(来自ServiceBehaviorAttribute或配置行为),以便将异常信息发送回客户端,或根据Microsoft .NET Framework 3.0 SDK文档打开跟踪并检查服务器跟踪日志。
我的服务详情:我打电话给第三方服务: http://www.webservicex.net/sunsetriseservice.asmx?op=GetSunSetRiseTime 创建我的服务。
编辑: 完整堆栈跟踪:
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
编辑2:服务说明:
http://www.webservicex.net/WS/WSDetails.aspx?WSID=65&CATID=12
这是因为我使用 asmx 服务而不是 .svc 。抱歉,如果我听起来很困惑
编辑3 服务器端web.config:https://gist.github.com/KodeSeeker/5226269
编辑4: ** IncludeExceptionDetailInFaults设置为true(P.S.我在远程服务器上工作,一直保持断开连接,所以我不确定这个错误是否也是因为这个):
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
答案 0 :(得分:0)
我首先看一下这条消息:
使用客户端身份验证方案禁止HTTP请求 '匿名'
您是否在IIS中启用了匿名身份验证?您可以在IIS管理器中检查它。