2

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?

AronChan
  • 245
  • 3
  • 19
  • Dont know if that error has anything to do with the unexpected attribute. You could try to save the metadata as an xml file, remove said attribute and let the code be newly generated from connected service. – segra Aug 21 '21 at 08:53

0 Answers0