I am trying to fetch a resource using dynamics web API call using REST.
URI -
https://capitalcloudinc.api.crm.dynamics.com/api/data/v8.0/roles
Headers -
content-type : application/json
Throwing following exception quite frequently, though it is not consistent.
"error":{
"code":"","message":"A value was encountered that has a type name that is incompatible with the metadata. The value specified its type as 'Microsoft.Dynamics.CRM.BooleanManagedProperty', but the type specified in the metadata is 'Microsoft.Dynamics.CRM.BooleanManagedProperty'.","innererror":{
"message":"A value was encountered that has a type name that is incompatible with the metadata. The value specified its type as 'Microsoft.Dynamics.CRM.BooleanManagedProperty', but the type specified in the metadata is 'Microsoft.Dynamics.CRM.BooleanManagedProperty'.","type":"Microsoft.OData.Core.ODataException","stacktrace":" at Microsoft.OData.Core.ValidationUtils.ValidateComplexTypeIsAssignable(IEdmComplexType expectedComplexType, IEdmComplexType payloadComplexType)\r\n at Microsoft.OData.Core.TypeNameOracle.ValidateMetadataType(IEdmTypeReference typeReferenceFromMetadata, IEdmTypeReference typeReferenceFromValue)\r\n at Microsoft.OData.Core.TypeNameOracle.ResolveAndValidateTypeFromNameAndMetadata(IEdmModel model, IEdmTypeReference typeReferenceFromMetadata, String typeName, EdmTypeKind typeKindFromValue, Boolean isOpenPropertyType)\r\n at Microsoft.OData.Core.TypeNameOracle.ResolveAndValidateTypeNameForValue(IEdmModel model, IEdmTypeReference typeReferenceFromMetadata, ODataValue value, Boolean isOpenProperty)\r\n at Microsoft.OData.Core.JsonLight.ODataJsonLightValueSerializer.WriteComplexValue(ODataComplexValue complexValue, IEdmTypeReference metadataTypeReference, Boolean isTopLevel, Boolean isOpenPropertyType, DuplicatePropertyNamesChecker duplicatePropertyNamesChecker)\r\n at Microsoft.OData.Core.JsonLight.ODataJsonLightPropertySerializer.WriteProperties(IEdmStructuredType owningType, IEnumerable`1 properties, Boolean isComplexValue, DuplicatePropertyNamesChecker duplicatePropertyNamesChecker, ProjectedPropertiesAnnotation projectedProperties)\r\n at Microsoft.OData.Core.JsonLight.ODataJsonLightWriter.StartEntry(ODataEntry entry)\r\n at Microsoft.OData.Core.ODataWriterCore.InterceptException(Action action)\r\n at System.Web.OData.Formatter.Serialization.ODataEntityTypeSerializer.WriteEntry(Object graph, ODataWriter writer, ODataSerializerContext writeContext)\r\n at System.Web.OData.Formatter.Serialization.ODataFeedSerializer.WriteFeed(IEnumerable enumerable, IEdmTypeReference feedType, ODataWriter writer, ODataSerializerContext writeContext)\r\n at System.Web.OData.Formatter.ODataMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, HttpContent content, HttpContentHeaders contentHeaders)\r\n at System.Web.OData.Formatter.ODataMediaTypeFormatter.WriteToStreamAsync(Type type, Object value, Stream writeStream, HttpContent content, TransportContext transportContext, 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.Web.Http.WebHost.HttpControllerHandler.<WriteBufferedResponseContentAsync>d__1b.MoveNext()"
}
}
}, ]], ]]