Wcf Data Service fails when more than 8 properties are specified in the 'select=' portion of the URI

Proposed Wcf Data Service fails when more than 8 properties are specified in the 'select=' portion of the URI

  • 2012年3月13日 10:17
     
     

    Hi:

    I am using WCF Data Service   and   Oracle  

    EF Provider is  ODAC11.2 Release 4

    here is my code

    var q = from c in this.ctx.SALESORDER_ITEM         
                       select new
                       {
                           c.SORDERDETAILID,
                           c.IID,c.DMFLAG,c.OWNERID,c.SKUID,c.SKU_ID,c.TRADENO,c.SOURCEID,c.SORDERID                 
                       };

    excetion:

    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()

     
     Is there a max number of properties in $select  statement

    I think  may be  it is oracle provider's problem ,but  i don't konw how to debug it   Can anyone help me

    Any help is greatly appreciated


    • 編集済み 王志凯 2012年3月13日 14:20
    •  

すべての返信

  • 2012年3月16日 2:01
    モデレータ
     
     

    This is very likely Oracle provider problem. We do have a test for more than 8 (a lot more) over SQL Server and it works just fine. But I don't know how to debug the Oracle provider either.

    Thanks,


    Vitek Karas [MSFT]

  • 2012年3月16日 8:48
     
     

    thanks Vitek,  but  I also find this postArgumentNullException when querying many fields. it's very similar to my problem but with another kind of reason.  Is there any way I can confirm the actual reason ?

    Also this  Wcf Data Service fails when

    Really appreciated!

     
    • 編集済み 王志凯 2012年3月16日 9:04
    •  
  • 2012年4月18日 4:00
     
     

    Hi Vitek,

    I haven't soved this problem yet,I report this to oracle onp.net forum, it's here

     And in another post ,it says 

    Unfortunately, this is designed behaviour. 
    We are unable to change OData projection rules.

    Do you agree with that?

    Please help me , thinks  a lot.

  • 2012年4月18日 12:18
    モデレータ
     
     回答の候補

    Hi,

    I would have to disagree. OData on its own doesn't limit projections at all. WCF DS uses some rather complex lambda expressions to translate lot of projections (>8) to the LINQ expression, but it should still work for any number of projections.

    We debugged this problem on our side a little and it seems that the DevArt provider projects a null value in place of an empty string in one of the cases. Another case of this happening is described in the thread: http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataservices/thread/e74ea4d1-a262-4326-8529-c146a3acfb6d.

    We are currently looking into possible solutions.

    Thanks,


    Vitek Karas [MSFT]

    • 回答の候補に設定 Ashwini47 2012年5月15日 18:04
    •  
  • 2012年5月3日 11:51
     
     
    This issue is still happening in WCF Data Services 5.1.0 RC
  • 2012年5月17日 11:30
     
      コードあり

    I did faces the same problem in other version of service and found a solution at devart forums.

    Just add one line to service init code 

    public static void InitializeService(DataServiceConfiguration config)
            {
    //  ….. Other code
                Devart.Data.Oracle.Entity.OracleEntityProviderServices.HandleNullStringsAsEmptyStrings = true;
            }

    For me it works , Detailed Reference can be found at 

    http://ashwini47-tts.blogspot.com/2012/05/wcf-data-service-fails-selecting-more.html


    • 編集済み Ashwini47 2012年5月17日 11:30
    •  
  • 2012年8月23日 17:52
    モデレータ
     
     
    Please refer to WCF DataServices 5.0.2 nuget release - http://nuget.org/packages/Microsoft.Data.Services/5.0.2-rc - that has a fix for this issue.