我正在尝试使用我创建的服务,该服务在部署在本地主机上时可以完美使用。但是当我在服务器(IIS)上部署后尝试使用相同的服务时。我收到以下错误
由于内部错误,服务器无法处理请求。有关错误的更多信息,请在服务器上打开 IncludeExceptionDetailInFaults(来自 ServiceBehaviorAttribute 或来自配置行为),以便将异常信息发送回客户端,或根据 Microsoft .NET Framework 3.0 SDK 文档打开跟踪并检查服务器跟踪日志。
关于我的服务的详细信息:我调用第 3 方服务: 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(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