如何在WCF服务中修复此错误?

时间:2017-04-30 11:15:54

标签: c# wcf web-applications service

我目前正在尝试使用WCF服务将数据输入数据库,

我一直在遵循本教程的步骤:http://www.c-sharpcorner.com/UploadFile/rohatash/inserting-data-into-database-using-wcf-service/

我已成功结束: enter image description here 但是,当我按下按钮时,数据不会被输入数据库;而是弹出这条消息:

Server Error in '/' Application

由于内部错误,服务器无法处理请求。有关错误的更多信息,请在服务器上启用IncludeExceptionDetailInFaults(来自ServiceBehaviorAttribute或配置行为),以便将异常信息发送回客户端,或者根据Microsoft .NET Framework SDK文档打开跟踪,检查服务器跟踪日志。 描述:执行当前Web请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息。

Exception Details: System.ServiceModel.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 SDK documentation and inspect the server trace logs.

来源错误:

Line 146:        
Line 147:        public string InsertUserDetails(WebAppTest2.ServiceReference1.UserDetails userInfo) {
Line 148:            return base.Channel.InsertUserDetails(userInfo);
Line 149:        }
Line 150:        

源文件:c:\users\mauro-buhagiarjl(848\documents\visual studio 2015\Projects\WebAppTest2\WebAppTest2\Service References\ServiceReference1\Reference.cs行:148

堆栈追踪:

[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 SDK documentation and inspect the server trace logs.]
   System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +153
   System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +336
   WebAppTest2.ServiceReference1.IService1.InsertUserDetails(UserDetails userInfo) +0
   WebAppTest2.ServiceReference1.Service1Client.InsertUserDetails(UserDetails userInfo) in c:\users\mauro-buhagiarjl(848\documents\visual studio 2015\Projects\WebAppTest2\WebAppTest2\Service References\ServiceReference1\Reference.cs:148
   WebAppTest2.WebFormTest.Button1_Click(Object sender, EventArgs e) in c:\users\mauro-buhagiarjl(848\documents\visual studio 2015\Projects\WebAppTest2\WebAppTest2\WebFormTest.aspx.cs:27
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9712582
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +204
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1639


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1637.0 

此消息源自哪里?

0 个答案:

没有答案