'The server was unable to process the request

2019-08-25 08:14发布

问题:

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). 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.

Details about my service: I call upon a 3rd party service : http://www.webservicex.net/sunsetriseservice.asmx?op=GetSunSetRiseTime to create my service.

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 . Sorry if I sound confused!
EDIT 3 Server side web.config : https://gist.github.com/KodeSeeker/5226269

EDIT 4: ** With IncludeExceptionDetailInFaults set true( P.S. Im working on a remote server that keeps disconnecting so Im not sure if this error is also because of that ):

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

回答1:

I would start by looking at this message:

The HTTP request was forbidden with client authentication scheme 'Anonymous'

Do you have Anonymous authentication enabled in IIS? You can check that in IIS Manager.