调用DB并返回List <t> </t>时出现异常

时间:2011-12-02 12:41:49

标签: wcf

我正在制作连接数据库并返回结果的WCF服务。四分之一的DataContracts没有问题(返回一个int),但其他三个给我一个异常(返回一个List)。在错误消息下面。

  

基础连接已关闭:连接意外关闭。

     

服务器堆栈跟踪:at   System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(引发WebException   webException,HttpWebRequest请求,HttpAbortReason abortReason)
  在   System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(时间跨度   超时)at   System.ServiceModel.Channels.RequestChannel.Request(消息消息,   TimeSpan超时)at   System.ServiceModel.Dispatcher.RequestChannelBinder.Request(消息   消息,TimeSpan超时)at   System.ServiceModel.Channels.ServiceChannel.Call(String action,   Boolean oneway,ProxyOperationRuntime操作,Object [] ins,   对象[]出局,TimeSpan超时)at   System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage   methodCall,ProxyOperationRuntime operation)at   System.ServiceModel.Channels.ServiceChannelProxy.Invoke(即时聊天   消息)

     

在[0]处重新抛出异常:at   System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(即时聊天   reqMsg,IMessage retMsg)at   System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&安培;   msgData,Int32类型)在IReceiverService.SatList()处   ReceiverServiceClient.SatList()

     

内部异常:底层连接已关闭:连接   意外关闭了。在System.Net.HttpWebRequest.GetResponse()   在   System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(时间跨度   超时)

1 个答案:

答案 0 :(得分:0)

您可能需要使用known type attributes

装饰返回的实体或服务