I am trying to access the retail API from a .net class using this example:
community.dynamics.com/.../how-to-access-retail-server-in-managed-code
However I'm getting the error below once it tries to execute
ChannelConfiguration channelConfiguration = await orgUnitManager.GetOrgUnitConfiguration();
Error:
Contoso.Retail.Ecommerce.Publishing.vshost.exe Error: 0 : System.InvalidOperationException: The response payload is a not a valid response payload. Please make sure that the top level element is a valid Atom or JSON element or belongs to 'docs.oasis-open.org/.../data' namespace.
at Microsoft.OData.Client.Materialization.ODataMaterializer.CreateODataMessageReader(IODataResponseMessage responseMessage, ResponseInfo responseInfo, ODataPayloadKind& payloadKind)
at Microsoft.OData.Client.Materialization.ODataMaterializer.CreateMaterializerForMessage(IODataResponseMessage responseMessage, ResponseInfo responseInfo, Type materializerType, QueryComponents queryComponents, ProjectionPlan plan, ODataPayloadKind payloadKind)
<-- Rest of stack trace cut -->
Any idea how to troubleshoot this?