2012-04-19 78 views
0

我有兩種方法的wcf basicHttpBinding服務。 方法1執行一個oracle打包的存儲過程,它在數據集中返回兩個數據表。這工作正常。WCF嘗試檢索數據表時發生錯誤但沒有數據集

方法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: 

回答

相關問題