6. C/FRONT
Pros Cons
Programmable interface to
NAV (credentials, license,
..)
Expensive licensing
scenarios
Slow in execution
Not easy to use
No business logic
execution
9. NAV Application Server
Pros Cons
Full-scale NAV “client”
Executes any business logic
Programmable and
extensible
No programmatic interface
Not synchronous
Requires programming in
NAV for anything
12. What about consuming a web service?
• COM
• XML Document
• XML HTTP
Freddy’s blog:
Connecting to NAV Web Services from
Microsoft Dynamics NAV 2009 SP1
14
13. In the old days
Challenging
Design
Difficult to
make
bulletproof
No Industry
Standard
Complex
Hard to
debug
16. Do we still KISS?
• Publishing Data/Business Logic has
been simplified by NAV 2009 Web
Services
• Consuming a web service in C/SIDE
is now much simpler in by .Net
Interop in NAV 2009 R2
21. Do it!
Demo 1:
• Execute Business Logic
– Math
• Consume published Codeunit
• Data and business Logic?
– Post Invoice
• Consume published page
• Extend webservice with codeunit
• Consuming 3rd Party web services
– Check VAT Number
• Create Proxy Class
• Use .Net Interop to Consume Web Service
26. NAV Consumes its own Web Service
Demo 2:
Story:
I want to show the external inventory
(=sum of the inventory of an item in
the other companies) on a factbox in
the Item List.
29
27. Steps:
1. Publish the data with NAV 2009 Web
Services
2. Create & deploy a proxy class
build with .Net Framework 3.5
3. Use .Net Interop to get to the data
30
29. Other application of Cannibalism
• Data sync Items/Customers/... in
other companies
• Generate PDF documents
• Intercompany
• Reminders – check Customer
Balance in other companies
• ...
32
30. Agenda
In the old
days
In these
days
Cannibalism
Going
somewhat
beyond
Key
Takeaways
33
• Limited extra
development
knowledge needed
• Create powerful
solutions in a simple
way
32. What about other technologies?
• Java
• Javascript
• C# using Web Reference
• C# using Service Reference
• Visual Basic using Web Reference
• Visual Basic using Service Reference
• Windows Mobile
• Microsoft Dynamics NAV 2009SP1
• PHP
• Others...
35
33. Web services authentication
• Consumers can authenticate:
– SPNEGO or Integrated Windows
Authentication (default)
– NTLM (java, php, ...)
• SSL can be used
– Walkthrough: Configuring Web Services
to Use SSL (MSDN)
• Standard NAV security applies
thereafter
34. What about other technologies?
It’s all about XML
<Soap:Envelope xmlns:Soap="http://schemas.xmlsoap.org/soap/envelope/">
<Soap:Body>
<Companies xmlns="urn:microsoft-dynamics-schemas/nav/system/">
</Companies>
</Soap:Body>
</Soap:Envelope>
Which returns:
<Soap:Envelope xmlns:Soap="http://schemas.xmlsoap.org/soap/envelope/">
<Soap:Body>
<Companies_Result xmlns="urn:microsoft-dynamics-schemas/nav/system/">
<return_value>ASTENA NV</return_value>
<return_value>CRONOS NV</return_value>
<return_value>IFACTO NV</return_value>
<return_value>MORE ICT NV</return_value>
</Companies_Result>
</Soap:Body>
</Soap:Envelope>
35. What about other technologies?
• Java
• Javascript
• C# using Web Reference
• C# using Service Reference
• Visual Basic using Web Reference
• Visual Basic using Service Reference
• Windows Mobile
• Microsoft Dynamics NAV 2009SP1
• Others...
• PHP
38
37. • Demo 4:
– Magento
• eCommerce Platform built on Open-Source
technology
– Extra module: NavisionSync
40
38. What about other technologies?
• Java
• Javascript
• C# using Web Reference
• C# using Service Reference
• Visual Basic using Web Reference
• Visual Basic using Service Reference
• Windows Mobile
• Microsoft Dynamics NAV 2009SP1
• PHP
• Others...
41
Freddy’s blog: http://blogs.msdn.com/freddyk/
39. Agenda
In the old
days
In these
days
Cannibalism
Going
somewhat
beyond
Key
Takeaways
42
• Provides a standard way of
connecting systems
• Almost no limit in
technologies that will be able
to consume NAV 2009 Web
Services
• Increase return on Microsoft
Dynamics NAV investment
• Consistent Integration
Method
47. Directions EMEA 2011
10 – 13 May 2011, Berlin
The NAV Partner Community
http://www.directionsemea.com
The only NAV focus conference !
48. Why attend
• Directions EMEA is organized for NAV
partners by NAV partners
• Objectives:
– Build a stronger and more engaged
EMEA wide NAV channel community.
– Enhance the partner relationship with
Microsoft.
– Get us what we need to be successful.
51
49. Why attend
• Partners
– Learn from eachother & network
– Meet the NAV product management and
development team
– Get the latest information
– Team up with NAV partners worldwide
• ISV’s
– Share your solution with NAV partners
worldwide
52
Editor's Notes
How to execute business logic from outside NAV (real time)
As for the C/Front cons: To me it’s one more additional proprietory system, and I really don’t need that anymore; it’s dead and it stinks. My main con against NODBC has always been that it can seriously impede system performance. If you do not use it extensively, you might just as well write a dataport; if you do, it can bring your system to a standstill quite easily. My main cons against automation are the old COM usage and deployment issues. The fact that you might need Visual Studio is only a con in the old way of thinking, not anymore today. NAS: I don’t mind that it requires some additional code. The fact that there is no programmatic interface is an issue, but could be solved by MS if they’d invest in it. The main point for me is that it really only allows asynchronous processes; that rules out quite a lot of scenarios.
1.Data input will be triggered in Navision. Modify data, Insert data en delete data.2.All primary key data will be added in the "out monitor queue" table. If the record has the right conditions it will be ready for sycnhronization.3.The NAS Scheduler Job "Export XML" will monitor the queue table. All records with process status :"Ready to process" will be processed.4.For each record an XML will be created and send to the right connector (in this case a webservice connector).5.The webservice receives the xml file. The data will be processed : insert, update or delete data.6.The data will be available for publishing on an website.
Web Service Consumer
Any client that understands how to communicate with Web Services; like InfoPath, Visual Studio, SharePoint or any custom application written by you.
Port
Is the physical communication port that the WCF listens to.
WCF Web Service
Defines the data contracts and service contracts for the Web Service, it also implements the concrete service and opens for listening in the WCF subsystem, it then delegates the requests to the COM Event Dispatcher component.
COM Event Dispatcher
This component provides the hookups for Dynamics NAV, both to activate the service and to register event sinks. It defines 2 IDispatch interfaces the IServiceEvents and the IWebServiceListner, as well as the concrete implementation of the IWebServiceListner in the WebServiceListner class that provides the actual code for hooking up the WCF Web Service to Dynamics NAV.
.NET
We are using the CLR runtime for writing our Web Service component and our COM plugin. Some of this blog entry is about interop between Dynamics NAV and .NET through COM.
Codeunit Event Handler
Is responsible for starting up the WCF Web Service through the COM interface, it then registered for events coming from the WCF Web Service Component. The events routed to XMLPort for processing.
XMLPorts for datastreams
It deals with the actual business logic and data coming from or going to the Web Service.
Show the complexity of consuming ... ?
What does it mean for NAV 2009
Web Services are:
Standardized
Widely used and understood
Supported by a lot of tools
Supported by Microsoft Dynamics
Often the most cost-effective way to approach integration
NAV2009:
PUBLISHING = making data and functionality available
not CONSUMING = utilizing a web service
KISS = Keep It Simple, Stupid
Show services
Restart: show event log
Open Web services form: Create web Service .. Show WSDL
Show services
Restart: show event log
Open Web services form: Create web Service .. Show WSDL
Stuart’s session (TECH5) – Thursday
HOL
Later: demo!
VAT Number Check!
Post invoice:
- using a page
- extending it functionality with a codeunit.
Walkthrough: Configuring Web Services to Use SSL (MSDN)
http://msdn.microsoft.com/en-us/library/ee414240.aspx
Javascript does not natively have support for strongly typed proxy class generation like C#, VB and Java nor does it have support for interpretation of Soap based webservices like PHP – it is all about XML.
In the end all of the other languages ends up creating a XML document (basically just a string), which is send over the wire to the the Web Service host who then replies back with a XML Document (again just a formatted string).
String manipulation is possible in Javascript and Javascript does have an object called XmlHttpRequest which can communicate with a XML Web Service host – we should be good.
The way NAV 2009 (and SP1) handles Web Services is using SOAP. You can read more about the basics here: http://en.wikipedia.org/wiki/SOAP. This image describes pretty well how your message is put into a body and inserted into an envelope, which the gets send.
Magento is a feature-rich eCommerce platform built on open-source technology that provides online merchants with unprecedented flexibility and control over the look, content and functionality of their eCommerce store. Magento’s intuitive administration interface features powerful marketing, search engine optimization and catalog-management tools to give merchants the power to create sites that are tailored to their unique business needs. Designed to be completely scalable and backed by Varien's support network, Magento offers companies the ultimate eCommerce solution
There are lots of integration possibilities for how various external systems and applications can be enhanched by
Integrate with Microsoft Dynamics NAV 2009 using Web Services.
”
Lets say one of your customers did an - automated - production order planning, and as part of that called their their vendors on-line with availabily and price requests, and finally placed orders – then, if you are a vendor, you would provide a Web Service for your Customer to call (Inquire on parts, Place orders and recieve confirmation).
”
Then, instead of manually going to your web site or place a phone call, the customers production order planning system could directly call your Microsoft Dynamics NAV 2009 using Web Services,
Query avaialability and
Place orders
Fast – efficient - directly