Webservice on Navision / Microsoft Dynamics version 5… or else

integrationmicrosoft-dynamicsnavisionweb-services

Go bounty!

This question has earned me a tumbleweed badge (7 views in 7 days!), which is somehow a strong confirmation that Navision has a very limited market share, which – I suspect – should be a confirmation Navision is neither all that great piece of software…

But hey… that's what we got as a back-end, so I am ready to fight with this. :-O

If there is some daring navision developer who is able to shed light onto this… the bounty is there for you! 🙂


Original Post

I have recently implemented a rather complex e-commerce system that interacts with a legacy back-end based on Navision 5. So far the exchange of data between the two platform has happened via XML files, but this method is quite clumsy and very much prone to mishaps.

Our needs are:

  1. To expose certain elements of the business logic of each platform to the other one (for example: "what's the total amount ever purchased by this customer?", "what are the products currently on offer?", "how many new customers have registered on the website?", etc…).
  2. To have mechanisms of feed-back / validation for the various transactions (for example: "Here's the a new order from customer X" … "Ok, got it, the order will now start to be processed" … "Ok, copy that, bye!").
  3. If possible, avoid playing around with files, but keeping all of this happening in terms of calls/ports/services…

The most natural way I could think of would be to integrate the two systems via webservice, but Navision 5 does not support this natively. So I did my "due diligence" and found a few things on MSDN including this article and this other one.

According to these articles it should not be that difficult to create a webservice on Navision 5, but when I suggested this solution to the team in charge of the legacy system, they told us that it is "pure theory" and they do not know of anybody who ever implemented it.

I have no reason to doubt their word, but mileage can vary… and I thought that maybe in the SO community there are professionals from other countries who actually implemented something similar and are available to share their experience.

So, my question is two-folded:

  1. Is there anybody who has tried this at home and would be available to share a bit on what have been the greatest difficulties, if the final result is reliable, if they think the outcome is worth the effort, etc… ?
  2. Is there anybody who faced a similar problem but solved it with a different approach and that would be available to present their solution ("I never did it myself, but if I had to do it I would do it like this…" type of answers are also welcome)?

Thank you in advance for your time! 🙂

Best Solution

I too will chime in with a not-too helpful answer about Nav 6 :)

I've just completed a project using Nav 6. Suprisingly, the webservices are VERY easy to expose and consume. It's really a trivial matter to go find a object in the webservices interface and tick a box to tell it to expose itself.

Unsuprisingly, the webservices don't work as you'd expect, you have to often use some trial-and error to get objects and properties to persist, as it's really touchy as to the sequence of events you use to save and object. And each object seems to work slightly differently. eg: To create a customer, I eventually found out that you have to create and save a blank customer, massage this new record with a codeunit, then fetch the record and then write the customer's attributes and save again. I expected to just create a new customer(), set the attributes and save in one quick swoop.

I guess you're not too keen on upgrading to Nav6, but off the top of my head, Here is how you could simulate web services:

Sharepoint can already consume and expose webservices, so that tier isn't a problem. Nav 5 doesn't have them 'naturally', but you could cook up your own program that acts as a webservice 'broker' - you're already getting info into and out of nav, via mostly XML. You could build this broker to take input as the xml files and massage them to use in a webservice call. You could even forgo the XML and write and read directly from the Db, as all the Nav info is stored there anyway. So here's what I'm thinking:

NAV <-> SQL SERVER <-> New 'broker' webservice <-> Sharepoint

Or if you already have the NAV API down pat and want to resuse your XML:

NAV <-> XML files <-> New 'broker' webservice <-> Sharepoint

If you are using XML and use filewatchers, the latency shouldn't be too bad, usually filewatchers pick up on a drop or change in milliseconds.

Hmm, but I'm thinking you are probably supposed to use BizTalk for stuff like this: NAV <-> BizTalk <-> Sharepoint

But I don't know how easy it would be to set up BizTalk to communicate with Nav. I'll bet that it's pretty straighforward to get comms working, but this is speculation.

In any case, I don't know how helpful this post is, but maybe it gives you a few ideas to go with.

Cheers, Lance

Related Question