How to consume an external web service from Navision

bultela
Member Posts: 6
Hello all,
May I ask you a question concerning invoking external web services ?
I read in Mr Ernst 's blog the possibility to invoke an external web service from Navision :
<<
Here is a link to a blog post about connecting to SOAP Web Services from inside NAV:
http://navcode.blogspot.dk/2012/01/conn ... -from.html
>>
Can you please tell me if this works also in NAV 2013 R2 ? (as automation variables are used)
and if not do I have to develop it in DOTNET ?
I have already read relevant MSDN help for NAV 2013 R2 but the external web service to consume has not been done with a proxy class (contrary to MSDN Help)
Note also that the web service to call has to export data from a table and not to import it.
I don't know which syntax to use to export data.
I would really appreciate an answer from you.
Thanks for your reply
abultel
May I ask you a question concerning invoking external web services ?
I read in Mr Ernst 's blog the possibility to invoke an external web service from Navision :
<<
Here is a link to a blog post about connecting to SOAP Web Services from inside NAV:
http://navcode.blogspot.dk/2012/01/conn ... -from.html
>>
Can you please tell me if this works also in NAV 2013 R2 ? (as automation variables are used)
and if not do I have to develop it in DOTNET ?
I have already read relevant MSDN help for NAV 2013 R2 but the external web service to consume has not been done with a proxy class (contrary to MSDN Help)
Note also that the web service to call has to export data from a table and not to import it.
I don't know which syntax to use to export data.
I would really appreciate an answer from you.
Thanks for your reply
abultel
0
Comments
-
You can read some here
http://www.dynamics.is/index.php?tag=web-services
________________________________
Gunnar Gestsson
Microsoft Certified IT Professional
Dynamics NAV MVP
http://www.dynamics.is
http://Objects4NAV.com0 -
The easiest way to consume web services these days is to create a DotNet Wrapper and drop it into the AddIns folder. This is a small piece of .net code that consumes the web service and parses the results out in a series of functions that NAV can understand.
There is no problem using server-side Dot-Nets as they only have to be installed on the server and not on the client and they do not have to be registered in the Client add-ins table
This is an example of one I wrote to talk to a free SOAP service that returns exchange rate informationusing System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Evosoft.DynamicsNAV.CurrencyWS { public class CurrencyWS { private FXConverter.Currency StringToCurrency(string CurrCode) { FXConverter.Currency Currency = new FXConverter.Currency(); for (int i = 0; i <= Enum.GetNames(typeof(FXConverter.Currency)).Length; i++) { Currency = (FXConverter.Currency)i; if (Currency.ToString() == CurrCode) { return (Currency); } } return (0); } public Double ExchangeRate(string FromISOCurrCode, string ToISOCurrCode) { FXConverter.Currency FromCurrency = StringToCurrency(FromISOCurrCode); FXConverter.Currency ToCurrency = StringToCurrency(ToISOCurrCode); FXConverter.CurrencyConvertor WS = new FXConverter.CurrencyConvertor(); return(WS.ConversionRate(FromCurrency,ToCurrency)); } } }
0 -
Hello James,
First, thank you for your answer.
But as I am not a Dotnet developper, I would like to understand a bit more your example.
When you say that "the small piece of .net code consumes the web service and parses the results out in a series of functions that NAV can understand" ; can you please explain me in your example where is the interface to Navision ?
Where are in your code the series of functions that can be understood by navision ?
How is done the call from navision ?
My goal is to call an existing web service with an argument and export a list of records from a navision table.
Thanks for your reply
Arnaud0 -
Hello Arnaud
Try using the link Gunnar poste din his answer. I did not and allthough I am not a DotNet developer either, I had the code up and working in NAV in 15 minutes by following his guide.0 -
Software Developer,
Archerpoint India Pvt. Ltd,Chennai.0 -
Check out this link
https://rockwithnav.wordpress.com/2016/02/23/consume-net-webservice-dotnet-data-type/Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/0
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