Consuming an external service
In Dynamics AX, external services can be used in a variety of scenarios for retrieving information from external providers. This could be currency exchange rates, address information, logistics data, and many others. Such external services can be consumed directly from X++ code, with the help of Visual Studio.
In this recipe, we will demonstrate how external services can be consumed from X++ code. For demonstration purposes, we will use the service created in the Creating a custom service recipe, and we will assume that this service is an external service.
How to do it...
Carry out the following steps in order to complete this recipe:
1. In Visual Studio, create a new Visual C# Class Library project named
ExtSrv
.2. Add a new service reference named
CurServices
, to the project.3. Copy the address from the WSDL URI field, from the Creating a custom service recipe, into the Address field:
4. In Visual Studio, add the project to the AOT by selecting the Add ExtSrv to...