Hi,
I have a quite simple WCF service method which returns an IQueryable, just for testing. Perhaps I got something wrong when trying to understand what IQueryable is designed for. I clearly plan to use this with the IQueryable provider of NHibernate later. But first I ran into some sort of serialization problems (at least I think it might be the problem) whenever using a WCF method returning an IQueryable. It doesn't even work for a simple string.
Here's my code:
public IQueryable<string> GetEquipmentConfigurations()
{
var returnValue = new List<string>();
returnValue.Add("test");
return returnValue.AsQueryable();
}
It might not have much sense, it's just for testing whether I really get those IQueryables over the wire using WCF. Whenever I call this method using a client like SoapUI I get a socket exception and a connection reset, just the same as if I was trying to return something that is not marked as DataContract. But the only thing I do here is trying to return some lousy string list. What's wrong with that?
I use basicHTTPBinding, here are my settings:
<system.serviceModel>
<services>
<service name="EquipmentConfigurationService" behaviorConfiguration="DefaultBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8000/Krones.KBase/Services/EquipmentConfigurationService"/>
</baseAddresses>
</host>
<endpoint address=""
binding="basicHttpBinding"
contract="Krones.MES.KBase.Public.Service.EquipmentDefinition.IEquipmentConfigurationService" />
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="DefaultBehavior">
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="True"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
The OperationContract attribute is set for the interface:
[OperationContract]
IQueryable<string> GetEquipmentConfigurations();
It all works well when just returning a simple string. Anyway I want to take profit from the IQueryable features using LINQ later.
Anybody any idea what's going wrong here?
Thanks and Cheers,
Stefan