Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

HTTP Requests in Dynamics AX

(0) ShareShare
ReportReport
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!

*This post is locked for comments

  • Martin Dráb Profile Picture
    Martin Dráb 230,371 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 230,371 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 230,371 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 230,371 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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,642 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans