尝试检索数据表但不是数据集时出现WCF错误

时间:2012-04-19 12:42:38

标签: wcf oracle

我有一个带有两个方法的wcf basicHttpBinding服务。 方法1执行oracle打包的存储过程,该存储过程返回数据集中的两个数据表。这很好。

方法2返回一个(单个)表,其中包含一个简单的选择语句。除了例外,这失败了 为什么?

System.ServiceModel.CommunicationException was caught
  Message=An error occurred while receiving the HTTP response to http://localhost:10500/WcfOracle.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.
  Source=mscorlib
  StackTrace:
    Server stack trace: 
       at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
       at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    Exception rethrown at [0]: 
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at svcOracleTestRig.wcfOracle.IWcfOracle.Select(String stmt, Boolean LeaveConnectionOpen)
       at svcOracleTestRig.wcfOracle.WcfOracleClient.Select(String stmt, Boolean LeaveConnectionOpen) in D:\iWorx-dev-v1\WCF4\svcOracle\svcOracleTestRig\Service References\wcfOracle\Reference.cs:line 180
       at svcOracleTestRig.Form1.button2_Click(Object sender, EventArgs e) in D:\iWorx-dev-v1\WCF4\svcOracle\svcOracleTestRig\Form1.cs:line 98
  InnerException: System.Net.WebException
       Message=The underlying connection was closed: An unexpected error occurred on a receive.
       Source=System
       StackTrace:
            at System.Net.HttpWebRequest.GetResponse()
            at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
       InnerException: System.IO.IOException
            Message=Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
            Source=System
            StackTrace:
                 at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
                 at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
                 at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
            InnerException: System.Net.Sockets.SocketException
                 Message=An existing connection was forcibly closed by the remote host
                 Source=System
                 ErrorCode=10054
                 NativeErrorCode=10054
                 StackTrace:
                      at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
                      at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
                 InnerException: 

1 个答案:

答案 0 :(得分:1)

相关问题