Hi all,
I watched very interesting videos about how to consume a REST web service using NAV 2013 and R2 version but all offer an example in Visual Studio.
I'd like to call the web service directly in C/AL and I don't have problem if I receive an XML response but in my case I'd like to know what is the best approch to work with a Web Service RESTful with messages in JSON.
Let me know your opinion or suggest me materials
Thank you
Eclipses
0
Comments
http://www.mibuso.com/dlinfo.asp?FileID=1123
http://james.newtonking.com/json
Example that you can rewrite in C/AL:
string json = @{
'CPU': 'Intel',
'PSU': '500W',
'Drives': [
'DVD read/writer'
/*(broken)*/,
'500 gigabyte hard drive',
'200 gigabype hard drive'
]
}";
JsonTextReader reader = new JsonTextReader(new StringReader(json));
while (reader.Read())
{
if (reader.Value != null)
Console.WriteLine("Token: {0}, Value: {1}", reader.TokenType, reader.Value);
else
Console.WriteLine("Token: {0}", reader.TokenType);
}
// Token: StartObject
// Token: PropertyName, Value: CPU
// Token: String, Value: Intel
// Token: PropertyName, Value: PSU
// Token: String, Value: 500W
// Token: PropertyName, Value: Drives
// Token: StartArray
// Token: String, Value: DVD read/writer
// Token: Comment, Value: (broken)
// Token: String, Value: 500 gigabyte hard drive
// Token: String, Value: 200 gigabype hard drive
// Token: EndArray
// Token: EndObject
BR
Torben
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.