Now that we have created and exposed our custom services, they are ready to be consumed. To do this, we use Visual Studio and write two code samples.
This first example of consuming the service deals with the retrieval of a title list. We want to be able to write a list of titles to the console window.
To add the service reference, perform the following steps:
In Visual Studio, create a console application.
Right-click on the Service References node and select the Add Service Reference… button. The Add Service Reference window opens.
In the Address drop-down box, specify http://DYNAX01:8101/DynamicsAx/Services/CVRCustomServices as the address for the service and then press Go. The address is queried and the services and operations that are available are listed.
In the Namespace dialog box, specify the namespace that you want to use: AxCustomServicesRef.
After performing these steps, the Add Service Reference window should...