Manuel

Manuel

  • NA
  • 1
  • 0

Problem with a DataTable in my DataContract

Mar 5 2009 5:21 PM
Hello,

I've got a little problem in my WCF Service and I haven't found an answer that could fix my problem yet.
In my ServiceContract a have declared a Function returning a DataTable, that works so far.
In my DataContract, I have a DataMember with the Type Object.
When this DataMember is a DataTable, and the Server returns this DataContract, the client throws an exception.

From my ServiceContract:

Public Interface IFormService

    <OperationContract()> _
    Function ListForms() As DataTable
....
------------

From my DataContract:

<DataContract()> _
Public Class ControlData

    <DataMember()> _
    Private oValue As Object
...
----------

When a DataTable is set to DataMember oValue, the Client throws the following exception:

An error occurred while receiving the HTTP response to
http://localhost:...
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.

Inner Exception:
{"The underlying connection was closed: An unexpected error occurred on a
receive."}


I've found an article in the net, where they said, that the MaxReceivedSize and the ReaderQuotas should be enlarged, but this doesn't really help for me. That is really strange for me because it works in the ServiceContract, but not in my DataContract.
Does anyone know how I can fix or workaround this problem ?

My Configuration for the Service:

wsHttpBinding
SecurityMode.Message
Security.Transport.ClientCredentialType.Windows