December 11, 2019|knowledge2 min read

Sending an XML message through webservice – A blog for Microsoft partners

Sending an XML message through webservice – A blog for Microsoft partners

Acumen’s Dynamics NAV/365BC development team continue to identify challenges that you may be facing as you use Dynamics NAV or 365 Business Central and are eager to show the way with smart fixes and workarounds – In this case Robert Bulugea, recently encountered some obstacles Sending an XML message through webservice. If you’ve come up against similar challenges, read on to see how Robert recommends you proceed.

“I needed to send orders in XML format over webservice calls and I soon realised that although there were some resources on how you can do that with JSON text structures, there weren’t many containing XML structures.

Let’s have a look how I achieved this in a few simple steps below:

In this instance I am logging the XML message that I need to send into a blob field of an integration log table.

Step 1 – I created the relevant fields here:

Step1_Table1.jpg

Step 2 – I also created a very simple XMLPort, feel free to create one suitable to your needs:

Step2_XMLPortTest1.jpg

Step 3 – Now what we need is to have two functions that would:

  • Stream the contents of a message into our blob field, which is exactly what the function below does
    Step3_1_SaveXMLMessage1.jpg
  • Stream the contents of our blob field into a text variable, exemplified in the ReadXML2Text procedure below
    Step3_2_ReadXML2Text1.jpg

Step4 – Sending the XML message to our destination with Http Post.

We then send the xml text variable to a codeunit were we are using the HTTPContent.writefrom function

Step4_SendHTTPPostXML1.jpg

To view or download the source code please click here to read this on Robert Bulugea’s blog

Robert Bulugea, Dynamics365 Drive – Dec 11, 2019

Robert Bulugea is part of Acumen’s team of expert programmers and regularly generates helpful content for our customers.

Robert’s blog content is showcased on his blog “Dynamics365 Drive – A Business Central Drive Blog”. Click here to see more useful content, tips and advice: https://abcdrive.blog/author/navdriven/

TAGS|
Dynamics 365 Business Central, Microsoft Dynamics NAV

You may also be interested in

Ready for the next level?

Start our conversation now and change how you do business

BRISBANE OFFICE

+61 7 3180 0612

info@acumencentral.com.au

MELBOURNE OFFICE

+61 7 3180 0612

info@acumencentral.com.au

AUCKLAND OFFICE

+64 9 526 1400

info@acumencentral.co.nz

WELLINGTON OFFICE

+64 4 461 7305

info@acumencentral.co.nz

Copyright 2026 by Acumen Consulting | Privacy Statement | Terms Of Use