Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

HTTP Requests in Dynamics AX

Posted on by 95

Hi all,

I need to integrate an external API with Dynamics AX. This API works as follows:

  1. Create HTTP request and send
  2. Catch the response, which will be XML
  3. Interpret the XML to pull the necessary data
Does anyone here know how to create HTTP requests and handle XML in Dynamics AX? I know using the business connector, I could create code in .NET, but I haven't done that before either. If that is the correct way, can someone please walk me through it?
Thanks in advance guys!
  • Martin Dráb Profile Picture
    Martin Dráb 228,126 Most Valuable Professional on at
    RE: HTTP Requests in Dynamics AX

    It's not very different. Look at this, for example: [View:https://stackoverflow.com/questions/2066489/how-can-you-add-a-certificate-to-webclient-c:750:50]

  • Ragoza Oleksandr Profile Picture
    Ragoza Oleksandr 735 on at
    RE: HTTP Requests in Dynamics AX

    is there any difference is sending httpS request  in comparison to http?

  • Suggested answer
    Dick Wenning Profile Picture
    Dick Wenning 8,705 on at
  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 228,126 Most Valuable Professional on at
    RE: HTTP Requests in Dynamics AX

    The C# project has been added to AOT and it's included in the .xpo. Unfortunately you can't get it easily if you don't have AX2012, so I've extracted the code to a separate class library for you (download). It's just to show the code, not to be built.

  • dabonz413 Profile Picture
    dabonz413 95 on at
    RE: HTTP Requests in Dynamics AX

    Great tutorial. Can I get a full source for the C# portion too though? I only saw the xpo file dowload.

  • Verified answer
    Martin Dráb Profile Picture
    Martin Dráb 228,126 Most Valuable Professional on at
    RE: HTTP Requests in Dynamics AX

    Sorry about the delay, nevertheless my post is finally available: Parsing XML files with .NET Interop. It's been written for AX2012 - you can use the same approach in AX2009 too, but you won't get such a seamless experience due to lack of managed proxies.

    It's not the only possible approach - you could use other .NET APIs or to load the remote file directly to XMLDocument instance in X++, for example. Simply use the most suitable technology for your particular task.

  • dabonz413 Profile Picture
    dabonz413 95 on at
    RE: HTTP Requests in Dynamics AX

    Does this work in 2009?

  • Martin Dráb Profile Picture
    Martin Dráb 228,126 Most Valuable Professional on at
    RE: HTTP Requests in Dynamics AX

    I have a nice example that I would like to publish this week, so if you can wait a while...

    If you can't wait, look at WebRequest class and XML-processing APIs - I used LINQ to XML. Using .NET APIs is really the most productive way.

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,277 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,126 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans