最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

使用Web API消费Dynamics AX 365FO数据实体(第3部分)/ Consuming Dynamics AX 365FO Data entities using Web API (Part 3)

网络文摘 William 1524浏览 0评论
Hi Guys, This is with the 3rd and final part of same demo, In this post we will see what is the code we need to write on wep api project to get the data from Dynamics ax 365. In this post we will be reading the purchase order data from Dynamics ax 365. In case if you have not read the previous two parts then follow these links https://msdax.wordpress.com/2018/03/20/consuming-dynamics-ax-365fo-data-entities-using-web-api-part-1/ https://msdax.wordpress.com/2018/03/22/consuming-dynamics-ax-365fo-data-entities-using-web-api-part-2/ To start with, we need to add few dll references on Web api project. Please make sure Microsoft.OData.Client dll should be of same version what we have referenced in AuthenticationUtility and ODataUnity project(These projects are previously discussed in last blogs). using Manage Nuget Package option we can install package for Microsoft.OData.Client Now with the simple coding part, we need to reference following dll. I have created this initConfiguration method to authenticate my call using Azure, GetAuthenticationHeader method is given on OAuthHelper class, we will pass true for web api projects. Then i have created this fillOrder method to fill the list based on the query i have read from Dynamics ax 365 for purchase orders. This is the main web api method for reading the purchase orders, i am reading top 50 for now. After all this simple coding and all the configuration effort, when i click run on the project, i got this cool browser with my results of orders. This is the result after all the effort,
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址