By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,705 Members | 2,017 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,705 IT Pros & Developers. It's quick & easy.

WCF + DataTable in OperationContract = Exception on client side

P: 11
My WCF:
Expand|Select|Wrap|Line Numbers
  1.     [ServiceContract]
  2.     public interface IWorkbookService
  3.     {
  4.         [OperationContract]
  5.         DataTable GetDownpayments(KeyValuePair<int, string> sgm);
  6.     }
  7.  
  8.     class WorkbookService : IWorkbookService
  9.     {
  10.         public DataTable GetDownpayments(KeyValuePair<int, string> sgm)
  11.         {
  12.             /// works fine, no exceptions here
  13.             return Common.GetDownpayments(selectedSegment);
  14.         }
  15.     }
  16.  
  17.  

AS soon as I invoke GetDownpayments() on client side I get:

System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:02:59.8430000'. ---> System.IO.IOException: The read operation failed, see inner exception. ---> System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:02:59.8430000'. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.ServiceModel.Channels.SocketConnection.Read Core(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
--- End of inner exception stack trace ---
at System.ServiceModel.Channels.SocketConnection.Read Core(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, Boolean closing)
at System.ServiceModel.Channels.SocketConnection.Read (Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
at System.ServiceModel.Channels.DelegatingConnection. Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
at System.ServiceModel.Channels.ConnectionStream.Read (Byte[] buffer, Int32 offset, Int32 count, TimeSpan timeout)
at System.ServiceModel.Channels.ConnectionStream.Read (Byte[] buffer, Int32 offset, Int32 count)
at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
at System.Net.Security.NegotiateStream.StartFrameHead er(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.NegotiateStream.StartReading(B yte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.NegotiateStream.ProcessRead(By te[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
--- End of inner exception stack trace ---
at System.Net.Security.NegotiateStream.ProcessRead(By te[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.NegotiateStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at System.ServiceModel.Channels.StreamConnection.Read (Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
--- End of inner exception stack trace ---

Server stack trace:
at System.ServiceModel.Channels.StreamConnection.Read (Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
at System.ServiceModel.Channels.SessionConnectionRead er.Receive(TimeSpan timeout)
at System.ServiceModel.Channels.SynchronizedMessageSo urce.Receive(TimeSpan timeout)
at System.ServiceModel.Channels.FramingDuplexSessionC hannel.Receive(TimeSpan timeout)
at System.ServiceModel.Channels.FramingDuplexSessionC hannel.TryReceive(TimeSpan timeout, Message& message)
at System.ServiceModel.Dispatcher.DuplexChannelBinder .Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(S tring action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(S tring action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.I nvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.I nvoke(IMessage message)

Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleRe turnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateI nvoke(MessageData& msgData, Int32 type)
at DSSIP_Test.ServiceReference1.IWorkbookService.GetD ownpayments(KeyValuePair`2 selectedSegment)
at DSSIP_Test.ServiceReference1.WorkbookServiceClient .GetDownpayments(KeyValuePair`2 selectedSegment) in C:\PRJ\DSSIP_Test\Service References\ServiceReference1\Reference.cs:line 205
There's nothing wrong with timeout, that's fo sure. Table to be returned is rather small - about 10 rows with 20 values in each. All other functions in IWorkbookService work flawlessly, even with much more size of transferred data.

What's wrong to my code?
Dec 3 '09 #1
Share this Question
Share on Google+
2 Replies


Frinavale
Expert Mod 5K+
P: 9,731
Is the Common.GetDownpayments() method closing the connection?
Have you tried stepping through this method using the debugger?

-Frinny
Dec 3 '09 #2

P: 11
It has nothing common with Sql connections, it just reads dat from XML file and I'm 100% sure that there's no problem with this method invoked locally. I tested this.
Dec 3 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.