Odata error on update

Posts   
 
    
ABOH
User
Posts: 148
Joined: 06-Sep-2011
# Posted on: 26-Apr-2013 19:28:21   

Hello,

I have an ASP.NET application that is using a Kendoui web grid to access a WCF Data Service using json. All of the usual CRUD operations are working properly, except for update. When I edit a record and send it to the service, I am receiving the following exception from LLBLgen. I simply changed the DisplayAs field from haha to hahaaaa. Can you please tell me what is wrong? I've included the REQUEST and RESPONSE.

Thanks,

Mike


REQUEST

PUT httpdisappointed /localhost:55931/Services/ExpirationTraxDS.svc/Mike(6L) HTTP/1.1 Host: localhost:55931 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0 Accept: application/json, text/javascript, /; q=0.01 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Content-Type: application/json; charset=UTF-8;odata=verbose DataServiceVersion: 2.0 MaxDataServiceVersion: 2.0 X-Requested-With: XMLHttpRequest Referer: httpdisappointed /localhost:55931/ Content-Length: 227 Cookie: ExpirationTrax_SelectedLanguage=en-US; ShareholderTrax_SelectedLanguage=en-US; ShareholderTrax_AutoLogin=false; ShareholderTrax_RememberName=False; ShareholderTrax_UserName=; ShareholderTrax_RememberPassword=False; ShareholderTrax_Password=; ExpirationTrax_AutoLogin=false; ExpirationTrax_RememberName=True; ExpirationTrax_UserName=EL/bJWLvtSGOItKdaPpYJT4KT6SKqjpRZHuTwjZI71Q=; ExpirationTrax_RememberPassword=True; ExpirationTrax_Password=aU7Ro4BodlQvyb2Roj07CQ==; Demo_AutoLogin=false; Demo_RememberName=False; Demo_UserName=; Demo_RememberPassword=False; Demo_Password= Connection: keep-alive

{"__metadata":

{"id":"http://localhost:55931/Services/ExpirationTraxDS.svc/Mike(6L)", "uri":"http://localhost:55931/Services/ExpirationTraxDS.svc/Mike(6L)", "type":"ExpirationTraxDS.MikeEntity"},"DisplayAs":"hahaaaa","MikeId":"6" }


RESPONSE

{"error":{"code":"","message":{"lang":"en-US","value":"An error occurred while processing this request."},"innererror":{"message":"Object reference not set to an instance of an object.","type":"System.NullReferenceException","stacktrace":" at System.ComponentModel.ReflectPropertyDescriptor.SetValue(Object component, Object value)\r\n at SD.LLBLGen.Pro.ODataSupportClasses.LLBLGenProODataServiceUpdateProvider.SetValue(Object targetResource, String propertyName, Object propertyValue) in c:\Myprojects\VS.NET Projects\LLBLGen Pro v4.0\Frameworks\LLBLGen Pro\RuntimeLibraries\ODataSupportClasses\LLBLGenProODataServiceUpdateProvider.cs:line 222\r\n at System.Data.Services.UpdatableWrapper.SetValue(Object targetResource, String propertyName, Object propertyValue)\r\n at System.Data.Services.Serializers.Deserializer.SetPropertyValue(ResourceProperty resourceProperty, Object declaringResource, Object propertyValue, IDataService service)\r\n at System.Data.Services.Serializers.ODataMessageReaderDeserializer.ApplyProperty(ODataProperty property, ResourceType resourceType, Object resource)\r\n at System.Data.Services.Serializers.EntityDeserializer.ApplyValueProperties(ODataEntry entry, ResourceType entityResourceType, Object entityResource)\r\n at System.Data.Services.Serializers.EntityDeserializer.ApplyEntityProperties(SegmentInfo segmentInfo, ODataEntry entry, ODataEntryAnnotation entryAnnotation)\r\n at System.Data.Services.Serializers.EntityDeserializer.Read(SegmentInfo segmentInfo)\r\n at System.Data.Services.Serializers.ODataMessageReaderDeserializer.Deserialize(SegmentInfo segmentInfo)\r\n at System.Data.Services.Serializers.Deserializer.ReadEntity(ResourceType& entityTypeInPayload)\r\n at System.Data.Services.Serializers.Deserializer.HandlePutRequest()\r\n at System.Data.Services.DataService1.HandlePutOperation(RequestDescription description, IDataService dataService)\r\n at System.Data.Services.DataService1.ProcessIncomingRequest(RequestDescription description, IDataService dataService)\r\n at System.Data.Services.DataService1.HandleNonBatchRequest(RequestDescription description)\r\n at System.Data.Services.DataService1.HandleRequest()"}}}

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 27-Apr-2013 00:45:12   

Looking at the line of code where it fails, it seems like if the value you passed was actually null.

  • Can you confirm that debugging your code?

  • What is your LLBLGen runtime library version? (http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7722)

  • What OData version are you using?

  • Is this a general behavior? or Do you see it only on certain circumstances (like some fields, some entities, etc.)?

David Elizondo | LLBLGen Support Team
ABOH
User
Posts: 148
Joined: 06-Sep-2011
# Posted on: 27-Apr-2013 02:52:55   

Moved to private forum due to confidential materials.