O'Reilly logo

Mastering Microsoft Dynamics AX 2012 R3 Programming by Mat Fergusson, Simon Buxton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exposing the vehicle group logic as a custom web service

To further highlight the benefits of writing coding decoupled from the user interface and the use of data contracts, we will create a service and use it in a C# project.

Writing services in AX is straightforward; for example, to create a service that returns "Hello world", we simply need to return the "Hello world" string. We do have to describe the service to the outside world, however, and this is done by a decoration at the method header.

Firstly, we need to tell the compiler that this is a web method, and the return type. In the case of the Hello world example, it is simply the following:

[AifCollectionTypeAttribute('return', Types::String), SysEntryPointAttribute(true)]

The AifCollectionAttribute ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required