Search code examples
odataaxaptadynamics-ax7d3fo

oData client limit classes


I am currently testing oData client in combination with Dynamics AX 7. The metadata file coming from AX is over 900'000 lines big and if i use the default oData client and auto generate a C# class file it won't build because of too many string literals (.net error).

Now i'm looking for a way to tell the client generator which classes to generate (by entity name for example) and which not (about 95% isn't needed on the client-side).

Sadly limiting the metadata on AX side is not an option.


Solution

  • We had a similar issue, where we had to modify the available $metadata information from an ODATA service. In our case we used the DataServiceContext generator and pointed to the original server URI but used Fiddler as a Proxy inbetween. By using a breakpoint in Fiddler we could serve our modifed $metadata xml to the DataServiceContext generator in Visual Studio. Works fine when you used sparingly and if the API is stable.