olingo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeroen NB (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OLINGO-1114) NULL value change the type when convert ClientEntity to a HttpEntity
Date Fri, 23 Mar 2018 09:54:00 GMT

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

Jeroen NB commented on OLINGO-1114:
-----------------------------------

I have also created a pull request: https://github.com/apache/olingo-odata4/pull/28

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

Mime
View raw message