尝试检索datatable而不是dataset时发生WCF错误
我有一个wcf basicHttpBinding服务,它有两种方法。 方法1执行oracle打包存储过程,该过程在数据集中返回两个数据表。这个很好用 方法2返回一个带有简单select语句的(单个)表。这失败了,只有一个例外 为什么?尝试检索datatable而不是dataset时发生WCF错误,wcf,oracle,Wcf,Oracle,我有一个wcf basicHttpBinding服务,它有两种方法。 方法1执行oracle打包存储过程,该过程在数据集中返回两个数据表。这个很好用 方法2返回一个带有简单select语句的(单个)表。这失败了,只有一个例外 为什么? 不要从web服务操作返回数据集。原因如下: System.ServiceModel.CommunicationException was caught Message=An error occurred while receiving the HTTP re
不要从web服务操作返回数据集。原因如下:
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: