all groups > dotnet web services > april 2008 >
You're in the

dotnet web services

group:

wcf (dotnet 3.5) and datatables


wcf (dotnet 3.5) and datatables Dani
4/23/2008 8:23:01 AM
dotnet web services:
Hi,

I'm running a little wcf service,
regular operations works fine, but when the returned type is a DataTable
like this:

[OperationContract]
DataTable GetItems();

(The call reaches the server, it fails upon returning)
(The DataTable that is returned is genrated by selecting a simple table from
sql server - Select ID, NAME from ItemTable through a DataAdapter that fills
a DataTable.

I get 1 of 2 errors at the client:

Error num 1:

An error occurred while receiving the HTTP response to
http://localhost:8731/Design_Time_Addresses/TEST/ServiceDataContract/. 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."}

2nd error (occure ocationally):


{"An unsecured or incorrectly secured fault was received from the other
party. See the inner FaultException for the fault code and detail."}

and in the Inner Exception:

{"The message could not be processed. This is most likely because the action
'http://tempuri.org/IServiceDataContract/GetItems' is incorrect or because
the message contains an invalid or expired security context token or because
there is a mismatch between bindings. The security context token would be
invalid if the service aborted the channel due to inactivity. To prevent the
service from aborting idle sessions prematurely increase the Receive timeout
on the service endpoint's binding."}

Other methods works fine !

Is there a problem moving DataTable like this over WCF ?

Thanks,

Re: wcf (dotnet 3.5) and datatables rickyjonesus@gmail.com
5/7/2008 8:14:42 AM
[quoted text, click to view]

Make sure you are using
Re: wcf (dotnet 3.5) and datatables Rod
5/15/2008 1:09:27 PM
I am getting a similiar error message. This is my first WCF service and it
is running on my development machine (XP Pro SP2) under IIS, and I am using
wsHttpBinding. The strange is I've stepped through the code in the WCF
service, it makes the call to the SQL Server database, it retrieves the data
and puts it into the DataTable object, and then I close the connection and
return the DataTable. However, in looking at the returned error message I
get the following:

"The underlying connection was closed: The connectioon was closed
unexpectedly."

(Which, frankly I do not understand. The connectino closing is not
"unexpected". I closed it, very intentionally. I was done with it, so why
does it say this???)

and according to the stack dump the InnerException has this error message:

"The message could not be processed. This is most likely because the action
'http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT/Cancel' is incorrect or
because the message contains an invalid or expired security context token or
because there is a mismatch between bindings. The security context token
would be invalid if the service aborted the channel due to inactivity. To
prevent the service from aborting idle sessions prematurely increase the
Receive timeout on the service endpoint's binding."

I generated the proxy class and config file using the SvcUtil.exe function,
and they also use wsHttpBinding. So I don't know what's going on here or
why.

--

Rod


[quoted text, click to view]

Make sure you are using
binding="wsHttpBinding"

AddThis Social Bookmark Button