Hello,

I am using Apache Olingo v4 java library in my project and it works great.
Thanks!

I am having issues calling one particular endpoint -
https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/merge?view=dynamics-ce-odata-9

*ISSUE :* *Cannot specify entity type  in request*. Cannot figure out if
this has to be passed in as an annotation or what. I tried passing it in as
a param but Library then appends its type as string param instead.

Expected request body to contain :
"@odata.type": "Microsoft.Dynamics.CRM.account"

Actual request body contain :
                "@odata.t...@odata.type": "String",
"@odata.type": "Microsoft.Dynamics.CRM.account"

The above request is causing exception inside crm since they do not expect
this param.
An error occurred while validating input parameters:
Microsoft.OData.ODataException: Does not support untyped value in non-open
type.
  at
System.Web.OData.Formatter.Deserialization.DeserializationHelpers.ApplyProperty(ODataProperty
property, IEdmStructuredTypeReference resourceType, Object resource,
ODataDeserializerProvider deserializerProvider, ODataDeserializerContext
readContext)
  at
System.Web.OData.Formatter.Deserialization.ODataResourceDeserializer.ApplyStructuralProperties(Object
resource, ODataResourceWrapper resourceWrapper, IEdmStructuredTypeReference
structuredType, ODataDeserializerContext readContext)
  at
Microsoft.Crm.Extensibility.OData.CrmODataEntityDeserializer.ApplyStructuralProperties(Object
resource, ODataResourceWrapper resourceWrapper, IEdmStructuredTypeReference
structuredType, ODataDeserializerContext readContext)
  at
System.Web.OData.Formatter.Deserialization.ODataResourceDeserializer.ReadResource(ODataResourceWrapper
resourceWrapper, IEdmStructuredTypeReference structuredType,
ODataDeserializerContext readContext)
  at
Microsoft.Crm.Extensibility.OData.CrmODataActionPayloadDeserializer.ReadEntry(ODataDeserializerContext
readContext, ODataParameterReader reader, IEdmOperationParameter parameter)
  at
Microsoft.Crm.Extensibility.OData.CrmODataActionPayloadDeserializer.Read(ODataMessageReader
messageReader, Type type, ODataDeserializerContext readContext)
  at System.Web.OData.Formatter.ODataMediaTypeFormatter.ReadFromStream(Type
type, Stream readStream, HttpContent content, IFormatterLogger
formatterLogger) [HTTP/1.1 400 Bad Request]


I have tried appending annotations to the object but those do not end up in
request body.


For reference, following request body works using postman (plain old http
client) :
{
    "Target": {
        "accountid": "b68c98c3-f339-e811-a955-000d3a137a33",
        "@odata.type": "Microsoft.Dynamics.CRM.account"
    },
    "Subordinate": {
        "accountid": "f89a8c95-2353-e811-a959-000d3a137896",
        "@odata.type": "Microsoft.Dynamics.CRM.account"
    },
    "UpdateContent": {
        "websiteurl": "pranaytest3.com",
        "@odata.type": "Microsoft.Dynamics.CRM.account"
    },
    "PerformParentingChecks": "false"
}

Thanks in advance for taking time to help me.
Pranay Kothari

Reply via email to