I was just working on an assignment where I got the need of the customer like they want the Item Picture via web service. Another validation they put in was they don’t want the item picture to be saved on any particular directory instead they want on fly.
Like most of my posts this has its origin in Microsoft Dynamics 365 Business Central development – specifically our build process – although it isn’t limited to that.
We had a need to call a SOAP web service from PowerShell (see below for the background if you’re interested). In the past I’ve used Invoke-WebRequest and added content-type and a SOAPAction header to the request
Lots of web service vendors these days are tightening their requirement security protocols, SSL was removed back on the hearthbleed days, and not TLS version 1.0 and 1.1 are getting outed too. So suddenly NAV code that has been working for years stop working unless you change your client to select TLS1.2. Thankfully, there is a simple trick to choose the security protocol used by DotNet.
In this post I demonstrate how you can get XML data from a Web Service and then process the XML in NAV in order insert the needed values into a table.
I made the example using a service provided by the National Bank of Romania. This Web Service, gives Exchange Rates in XML format and I think it’s a good example for learning/practice purposes because it does not require a key and the XML is not too complex: