[ 
https://issues.apache.org/jira/browse/OLINGO-1114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16397532#comment-16397532
 ] 

Jeroen Ninck Blok commented on OLINGO-1114:
-------------------------------------------

Hi,

We are also running into this issue. I have created a similar fix before I 
found this issue. Is it possible to review the pull request or is a new pull 
request required?

Jeroen

> NULL value change the type when convert ClientEntity to a HttpEntity
> --------------------------------------------------------------------
>
>                 Key: OLINGO-1114
>                 URL: https://issues.apache.org/jira/browse/OLINGO-1114
>             Project: Olingo
>          Issue Type: Bug
>    Affects Versions: (Java) V4 4.3.0
>            Reporter: Jin ZHAO
>            Priority: Major
>              Labels: easyfix, unit-test
>         Attachments: TestEntityConvert.java, result_compare.png
>
>
> Please see my attached test code:
> ClientEntity add a property "revenue" with null value. and type is "Decimal"
> But when convert to HttpClient type. the type change to "String"
> When I use this for Microsoft CRM create entity, I got this kind of error 
> message.
> {code}
> {
>   "error":{
>     "code":"","message":"A value was encountered that has a type name that is 
> incompatible with the metadata. The value specified its type as 'Edm.String', 
> but the type specified in the metadata is 'Edm.Decimal'.","innererror":{
>       "message":"A value was encountered that has a type name that is 
> incompatible with the metadata. The value specified its type as 'Edm.String', 
> but the type specified in the metadata is 
> 'Edm.Decimal'.","type":"Microsoft.Crm.CrmHttpException","stacktrace":"   at 
> Microsoft.Crm.Extensibility.OData.CrmODataUtilities.ValidateInputParameters(ModelStateDictionary
>  controllerModelState)\r\n   at 
> Microsoft.Crm.Extensibility.OData.EntityController.PostEntitySet(String 
> entitySetName, EdmEntityObject entityObject)\r\n   at lambda_method(Closure , 
> Object , Object[] )\r\n   at 
> System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object
>  instance, Object[] methodParameters)\r\n   at 
> System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object
>  instance, Object[] arguments)\r\n   at 
> System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext
>  controllerContext, IDictionary`2 arguments, CancellationToken 
> cancellationToken)\r\n--- End of stack trace from previous location where 
> exception was thrown ---\r\n   at 
> System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at 
> System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
>  task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n 
>   at 
> System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n---
>  End of stack trace from previous location where exception was thrown ---\r\n 
>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at 
> System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
>  task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n 
>   at 
> System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n---
>  End of stack trace from previous location where exception was thrown ---\r\n 
>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at 
> System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
>  task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n 
>   at 
> System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
>     }
>   }
> }
> {code}
> *So the type of null value property should not be changed!*



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to