当前位置:编程学习 > C#/ASP.NET >>

CALL WCF出错,大家帮我看看

WCF中的程序:
        
[OperationContract]
        public List<dSupplier> getSupplier()
        {
            //DataClsDataContext dtc = new DataClsDataContext();
            //var med = from n in dtc.dMedicine select n;
            //return med.ToList<dMedicine>();

            var supp = from n in dtc.dSupplier
                       //where n.ISUsable.Equals("Y")
                       select n;
            return supp.ToList<dSupplier>();            
        }

        

WCF调用的时候,其他方法可以。调用这个方法的时候报错如下:
未能调用服务。可能的原因: 服务已脱机或无法访问;客户端配置与代理不匹配;现有的代理无效。有关详细信息,请参阅堆栈跟踪。可以尝试通过启动新的代理、还原到默认配置或刷新服务来恢复。


错误详细信息

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


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.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
   在 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)
   在 WCFService.getSupplier()
   在 WCFServiceClient.getSupplier()


补充:.NET技术 ,  .NET Framework
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,