服務端的代碼
var roles = from re in db.Roles ? select re;? ? ? ? ? ? ? ??
return roles.ToList();
調試的時候能進入服務端代碼,并能查到正確數據返回,數據量才二條,返回的數據大小不會超過默認設置的大小的。
但是在客戶端就會報出異常,調用wcf 基礎連接已經關閉: 連接被意外關閉。
未處理 System.ServiceModel.CommunicationException? Message=基礎連接已經關閉: 連接被意外關閉。? Source=mscorlib? StackTrace:? ? Server stack trace:?? ? ? ?在 System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)? ? ? ?在 System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)? ? ? ?在 System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)? ? ? ?在 System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)? ? ? ?在 System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)? ? ? ?在 System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)? ? ? ?在 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)? ? Exception rethrown at [0]:?? ? ? ?在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)? ? ? ?在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)? ? ? ?在 Ship.PurviewWCFService.IPurviewService.GetAllRole()? ? ? ?在 Ship.PurviewWCFService.PurviewServiceClient.GetAllRole() 位置 D:\WorkSpace\Shipmvc\Ship\Ship\Service References\PurviewWCFService\Reference.cs:行號 780? ? ? ?在 Ship.Purview.PurivewMain.BindRole() 位置 D:\WorkSpace\Shipmvc\Ship\Ship\Purview\PurivewMain.cs:行號 381? ? ? ?在 Ship.Purview.PurivewMain.角色管理ToolStripMenuItem_Click(Object sender, EventArgs e) 位置 D:\WorkSpace\Shipmvc\Ship\Ship\Purview\PurivewMain.cs:行號 423? ? ? ?在 System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)? ? ? ?在 System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)? ? ? ?在 System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)? ? ? ?在 System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)? ? ? ?在 System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)? ? ? ?在 System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)? ? ? ?在 System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)? ? ? ?在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)? ? ? ?在 System.Windows.Forms.Control.WndProc(Message& m)? ? ? ?在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)? ? ? ?在 System.Windows.Forms.ToolStrip.WndProc(Message& m)? ? ? ?在 System.Windows.Forms.MenuStrip.WndProc(Message& m)? ? ? ?在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)? ? ? ?在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)? ? ? ?在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)? ? ? ?在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)? ? ? ?在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)? ? ? ?在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)? ? ? ?在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)? ? ? ?在 System.Windows.Forms.Application.Run(Form mainForm)? ? ? ?在 Ship.Program.Main() 位置 D:\WorkSpace\Shipmvc\Ship\Ship\Program.cs:行號 19? ? ? ?在 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)? ? ? ?在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)? ? ? ?在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()? ? ? ?在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)? ? ? ?在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)? ? ? ?在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)? ? ? ?在 System.Threading.ThreadHelper.ThreadStart()? InnerException: System.Net.WebException? ? ? ?Message=基礎連接已經關閉: 連接被意外關閉。? ? ? ?Source=System? ? ? ?StackTrace:? ? ? ? ? ? 在 System.Net.HttpWebRequest.GetResponse()? ? ? ? ? ? 在 System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)? ? ? ?InnerException:?
請教園子里的兄弟,幫忙提示一下
- 8 回答
- 0 關注
- 1512 瀏覽
添加回答
舉報
0/150
提交
取消