I have a pretty simple WCF service method that returns IQueryable, for testing only. Maybe something is wrong with me when I try to understand what IQueryable is for. I clearly plan to use this with the IQueryable NHibernate provider later. But first, I ran into some serialization issues (at least I think it might be a problem) when using the WCF method returning IQueryable. This does not even work for a simple string.
Here is my code:
public IQueryable<string> GetEquipmentConfigurations() { var returnValue = new List<string>(); returnValue.Add("test"); return returnValue.AsQueryable(); }
It might not make much sense, it's just to check if I really get these IQueryables wiring using WCF. Whenever I call this method with a client such as SoapUI, I get a socket exception and a reset connection, just as if I were trying to return something that is not marked as DataContract. But the only thing I am doing here is trying to return some lousy list of strings. What is wrong with this?
I am using 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();
Everything works well, just returning a simple string. Anyway, I want to profit from IQueryable functions using LINQ later.
Does anyone know what is going wrong here?
Thanks and greetings
Stephen
Pilsator
source share