Skip to main content
Answered

oData client

editSubscribe (0) ShareShare
ReportReport
Posted on by 335

Hello,

has anyone successfully used an oData client recently ?

in the past I have successfully used the v4 oData client code generator to create the client :

https://marketplace.visualstudio.com/items?itemName=bingl.ODatav4ClientCodeGenerator

It appears that nowadays in 10.0.5 PU29, the entity metadata has grown so much that Visual Studio can't even 

create the client file anymore. I had to remove ten thousands of lines in the GenerateEdmModel class just to be

able to compile ODataClient.cs. As a result, it does not work properly, probably because of the missing metadata.

Following the pattern below, I'm running into errors such as {"Length cannot be less than zero.\r\nParameter name: length"}

for instance for code that used to run successfully (https://github.com/microsoft/Dynamics-AX-Integration)

private abstract class GeneratedEdmModel
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "7.5.1")]
private static global::Microsoft.OData.Edm.IEdmModel ParsedModel = LoadModelFromString();
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.OData.Client.Design.T4", "7.5.1")]
private const string Edmx = @"<edmx:Edmx Version=""4.0"" xmlns:edmx=""">">docs.oasis-open.org/.../edmx"">

<edmx:DataServices>

<Schema Namespace=""Microsoft.Dynamics.DataEntities"" xmlns=""">">docs.oasis-open.org/.../edm"">
<EntityType Name=""ElectronicPaymentType"">
<Key>
<PropertyRef Name=""PaymentType"" />
<PropertyRef Name=""dataAreaId"" />
</Key>

Question is, am I doing something wrong or someone else experiencing the same ? And is there a work around or

alternative ?

Categories: