NAV Web Service to read and parse JSON stream

tarkmyler
Member Posts: 57
I have a client that uses a cloud based customer service application call ZenDesk. Targets and Triggers can be defined in the application to send "ticket" information. I got excited about it and created an XMLPort and corresponding Codeunit. I added it to the Web Services. I even wrote a C# window application \:D/ to enter and send data in XML format to my new web service. I was all set to receive xml documents representing customer service tickets and turn those into interactions in NAV.
However, today I find that Zendesk uses JSON format, not xml. ](*,)
There isn't much in the forums regarding JSON, and certainly no examples in C/Side. I dredged up a couple of links, like:
http://msdn.microsoft.com/en-us/library/bb412179.aspx
I suppose that I could try and reference something like this with the new .NET variable type, but I'm still having a tough time figuring out if I try and read a stream or what exactly I do on the C/Side to read and processs a JSON data stream.
Help! :?
However, today I find that Zendesk uses JSON format, not xml. ](*,)
There isn't much in the forums regarding JSON, and certainly no examples in C/Side. I dredged up a couple of links, like:
http://msdn.microsoft.com/en-us/library/bb412179.aspx
I suppose that I could try and reference something like this with the new .NET variable type, but I'm still having a tough time figuring out if I try and read a stream or what exactly I do on the C/Side to read and processs a JSON data stream.
Help! :?
Mark Tyler
Pacific City, OR
Pacific City, OR
0
Comments
-
I have not been able to find any simple out of the box solution to handle JSON requests directly in NAV. But with the advances of moving to the cloud in NAV 2015 and beyond, this is something that is hopefully addressed natively in the near future.
In the meantime I think the best solution is to build a wrapper class in .NET and is called by NAV. There are several implementations of JSON serializer tools and REST tools that can be used in .Net to allow you to work with JSON based web services (which seems to be a very common pattern for Cloud API's). There is at least one MSDN article on how to expose OData queries as JSON (see: http://msdn.microsoft.com/en-us/library/dn127071(v=nav.71).aspx)0 -
If you want to use the .NET approach take a look at James Newtonking's Json.net (http://james.newtonking.com/json)
I also posted a small example how it is possible to parse JSON in NAV, but you have to write a lot of code:
viewtopic.php?f=32&t=614890 -
Thanks for the suggestions!Mark Tyler
Pacific City, OR0 -
Hi,
just for the case someone is interested:
for connecting a Navision with Shopware i wrote my own REST/JSON Wrapper direct in Navision without any additional software.
Natural there is a external component, but only Microsoft components you find on every Windows-computer since 2003/Xp, so you don't need to setup any DLL's, programms or whatever on the using client computers.
Currently the page is only in German because Shopware is very (only?) popular in Germany, but the examples are easy to read (just ignore the german text).
https://sites.google.com/site/renethoen ... e-mit-josn
If you want to drive a Shopware system out of Navision you might also be interested in a complete PIM Solution direct inside of Navision.
Also in German but with a lot of explaining Pictures:
https://sites.google.com/site/renethoene/navision/pim
Hope i can help someone with this. Both Solutions are also to sell. Documentation will be more in the future.1
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions