locked
Wcf Data Service fails when too many properties are specified in the 'select=' portion of the URI RRS feed

  • Question

  • Hey guys - this is very strange (to me anyways).

    Env: VS2010, WCF Data Service

    Problem: I can query the service just fine (querying a single entity), if I use 8 property names in the '@select=' . The moment I add another property to the selects, I get this exception (it does not matter what the additional property's type is):

    InvalidOperationException: An error occurred for this query during batch execution. See the inner exception for details

    The inner exception is null, but the DataServiceClientException states: Value cannot be null Parameter name: value 

    the exception is thrown in base.OnStartProcessingRequest(args) method (overridden).

    Here is the call stack as well:

       at System.Data.Services.WebUtil.CheckArgumentNull[T](T value, String parameterName)

       at System.Data.Services.Internal.ProjectedWrapper.set_PropertyNameList(String value)

       at lambda_method(Closure , Shaper )

       at System.Data.Common.Internal.Materialization.Coordinator`1.ReadNextElement(Shaper shaper)

       at System.Data.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext()

       at System.Data.Services.Internal.ProjectedWrapper.EnumeratorWrapper.MoveNext()

       at System.Data.Services.DataService`1.SerializeResponseBody(RequestDescription description, IDataService dataService)

       at System.Data.Services.DataService`1.HandleNonBatchRequest(RequestDescription description)

       at System.Data.Services.DataService`1.HandleRequest()

     

    has anyone ran into this before? I was thinking it to be a URI length issue, but the entire length of it is 180 char...

    Please let me know if I need to provide additional info..

    Any help is greatly appreciated,

     

    G.

     


     


    G.
    Monday, December 13, 2010 11:04 PM

All replies

  • Hi,

    What provider do you use? Is it reflection over LINQ to SQL?

    Thanks,


    Vitek Karas [MSFT]
    Tuesday, December 14, 2010 1:04 PM
    Moderator
  • Hi Vitek - 

     

    I am using a 3rd party EF provider for Oracle (Devart) but the exception thrown is withing the .Net stack it seems...


    G.
    Tuesday, December 14, 2010 2:44 PM
  • Vitek - 

     

    Here is another piece of info I just found out -  the URI length is what matters: if the resulting URI (resulting form a client side LINQ query) is longer than 170 (or so) characters, then the service fails with the ArgumentNullException mentioned above. Or maybe the length of the '$select=' portion is what matters? Just a guess... 


    G.
    Tuesday, December 14, 2010 4:34 PM
  • Hi

    Is it possible for you to paste the URI that is formed - the one without exception and one with exception

     


    kashyapa
    Tuesday, December 14, 2010 6:17 PM
  • Lohith - 

     

    I could post the IRIs but do not see how this can possibly be helpful:

    an example of an URI that works would be : http://myservice/Contacts()?$top=10&$select=Field1, Field2, Field3. etc. until you reach 180 characters. After you pass the char limit the exception is thrown.


    G.
    Tuesday, December 14, 2010 8:13 PM
  • I do have the same problem as yours. Have you solved it already?  Please let me know.

    Really appreciated!

    Friday, March 16, 2012 9:02 AM