Exposing a web service
Three types of NAV objects can be published as Web Services: Pages, Queries, and Codeunits. The essential purposes are:
- Pages provide access to the associated primary table. Use Card Pages for table access unless there is a specific reason for using another page type.
- Codeunits provide access to the functions contained within each Codeunit.
- Queries provide rapid, efficient access to data in a format that is especially compatible with a variety of other Microsoft products as well as products from other vendors.
An XMLPort can be exposed indirectly as a Codeunit parameter. This provides a very structured way of exposing NAV data through a Web Service. (See AJ Kauffmann's blog series on XMLPorts in Web Services at http://kauffmann.nl/index.php/2011/01/15/how-to-use-xmlports-in-web-services-1/). There is an example later in this chapter.
When a Page has no special constraints, either via properties or permissions, there will normally be eleven methods available...