Microsoft Dynamics NAV 2009 introduces a service tier and the ability to expose What are Codeunit objects? and Pages as web services. The web services can be used by applications such as Excel to call Navision business logic via codeunits or read and update data through Page objects.
Microsoft Dynamics NAV 2009 supports exposing pages and codeunits as Web services. Pages and codeunits can also be combined to offer even more functionality on the page Web service.
When a page is exposed as a Web service, a default set of eight methods is exposed to developers so that they can manage common record handling, such as Create, Update, and Read. A page Web service offers the built-in concurrency and transaction management, as opposed to codeunits.
In connection with page Web services it is possible to use extension codeunits to extend the default set of methods that are available on a page with codeunit functionality. Adding an extension codeunit to a page is useful if you want to perform operations other than CRUD operations on data. The benefits from adding an extension codeunit to a page is that you get integrated security, as well as concurrency and transaction management built into the page.
If you want functions from a codeunit to be accessible in a Page Web service, your codeunit function must have a record variable of type Record and a Subtype which is the same table as the table that is the source expression for the Page (for example on the Item Card, the first parameter must be a record variable of subtype Item). The codeunit must also have the same name as that which you have provided for the Page web service (for example if your Item Card page is called Items on the Web Services table, your codeunit must also be called Items). Finally the codeunit should not be ticked as published. When you are handling the the function call inside the codeunit, the first parameter represents the record that the function should operate on.
Codeunit Web services provide the developer with the most control and flexibility around the behavior of the Web service.
When a codeunit is exposed as a Web service, no default set of methods is exposed to developers. The methods that should be available on a codeunit are decided by the developer of the codeunit.
Concurrency is not managed automatically when a codeunit is exposed as a Web service, each codeunit call is managed as a single transaction.
How to publish a NAV 2009 web service?
How to create a NAV 2009 Web Service? - Part 1 - Sample fuel appl.
How to create a NAV 2009 Web Service? - Part 2a - Forms and Pages
How to create a NAV 2009 Web Service? - Part 2b - Forms and Pages - TIF Editor
How to create a NAV 2009 Web Service? - Part 3 - Finally a Web Service
How to use Reflection to call NAV 2009 Web Services?
This is a nice Article. One thing when we can't give name with space in Web Service. Eg.(Page 21 "Customer Card" should be give "Customer_Card" service name in Web Service Table.) .If we given name with space we can't see our codeunit function.