Connecting and using ODataV4 Connected Service with Dynamics NAV 2017 Causes Payload Error

443 Views Asked by At

I'm currently developing a C# application to handle the integration between a Dynamics 2017 and a online trading platform.

I have exposed my Dynamics 2017 pages as webservices and enabled the ODataV4 on the service tier.

In my C# application when creating the connected service (from a downloaded sample of the edmx since OData Connected Service Nuget package cant authenticate) i get the following errors when creating the generic classes: enter image description here

However the ODataV4 Connected Service still completes. It also works!

When i use the ODataV4 service it succesfully transfers my data to the Dynamics NAV tables however it throws an exception in the Event Viewer.

I want to eliminate this exception but i cant find anything online about this issue.

An error occurred while processing this request.. 
Inner Exception: System.InvalidOperationException: 
The context URI 'ODataV4 Endpoint Redacted' is not valid for the expected payload kind 'Resource'. ---> 
Microsoft.OData.ODataException: 
The context URI 'ODataV4 Endpoint Redacted' is not valid for the expected payload kind 'Resource'.
Microsoft.OData.JsonLight.ODataJsonLightContextUriParser.Parse(IEdmModel model, String contextUriFromPayload, ODataPayloadKind payloadKind, Func`3 clientCustomTypeResolver, Boolean needParseFragment, Boolean throwIfMetadataConflict)
Microsoft.OData.JsonLight.ODataJsonLightDeserializer.ReadPayloadStart(ODataPayloadKind payloadKind, PropertyAndAnnotationCollector propertyAndAnnotationCollector, Boolean isReadingNestedPayload, Boolean allowEmptyPayload)

Is anyone familiar with the issue?

0

There are 0 best solutions below